PHP Send Emails

PHP uses a simple function called mail() to send emails. This function requires mainly where to send email (to), the subject of email (subject), the message (message) and from address (from).

A simple Example of PHP Mail Function

How to send HTML Emails using PHP?

To send HTML emails using mail() function we will need to add a MIME type. Our message header should contain MIME type.



MIME stands for Multipurpose Internet Mail Extensions. It is a set of instructions that allows emails to be sent in more than just plain text. Content-Type sets what type of data is going to be sent. The default value would be “text/plain”.

Charset is character set. Each language or set of characters has its own title or name. This value lets the recipient email know which one is used to display the body message.

Click here to read about PHP include().