How to Send Mail Using PHP

Mailing is very important functionality in any web application,in PHP to send mail is very using php mail() function.PHP mail() function is used to send mail from web server.You can send mail as a plain text or with html element.

You can add HTML content and CSS styles with the message body of the mail.I am sharing separate article for send HTML content email using PHP.

PHP mail() function has features to send mail to multiple recipients using php email headers.You can add in mail header like From, Cc, and Bcc using php mail headers.

You can also check other tutorial of php mail,

The syntax of php mail function is:

Where mail() Parameters are:

  • to : This is used to Receiver email id, or receivers email ids of the mail.
  • subject : Subject of the email to be sent.
  • message : Message to be sent.
  • additional_headers : This will use to add extra headers (From, Cc, and Bcc). Multiple extra headers should be separated with a CRLF (\r\n).

Sample Code To Send Mail Using PHP

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.