Created
May 20, 2012 20:52
-
-
Save apphp-snippets/2759490 to your computer and use it in GitHub Desktop.
Send Mail using mail function in PHP
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 | |
/* Source: http://www.apphp.com/index.php?snippet=php-get-remote-ip-address */ | |
$to = '[email protected]'; | |
$subject = 'Test Email'; | |
$body = 'Body of your message here. You can use HTML tags also, e.g. <br><b>Bold</b>'; | |
$headers = 'From: John Smith'."\r\n"; | |
$headers .= 'Reply-To: [email protected]'."\r\n"; | |
$headers .= 'Return-Path: [email protected]'."\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