Created
January 27, 2014 21:24
-
-
Save jms/8657596 to your computer and use it in GitHub Desktop.
send test email using PHP mail function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $to = "test@example.com"; | |
| $subject = "test"; | |
| $body = "Body of your message here you can use HTML too. e.g. <br> <b> Bold </b>"; | |
| $headers = "From: Peter\r\n"; | |
| $headers .= "Reply-To: noreply@example.com\r\n"; | |
| $headers .= "Return-Path: noreply@example.com\r\n"; | |
| $headers .= "X-Mailer: PHP5\n"; | |
| $headers .= 'MIME-Version: 1.0' . "\n"; | |
| $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; | |
| mail($to,$subject,$body,$headers); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment