"How do I send emails using PHP?"

Below is an example of using PHP to send an email.



mail("my-receipient@somewhere-else.com", "the subject of the email", "the body of the email\nLine 1\nLine 2\nLine 3",
"From: webmaster@mydomain-name.com\r\n"
."Reply-To: webmaster@mydomain-name.com\r\n"
."X-Mailer: PHP/" . phpversion());

mail sent

Please take note of the "\n" and "\r\n". They make your email "more acceptable" to most SMTP servers.

The definitive documentation on how to use the PHP mail() function can be found at