Author: ApPHP Language: text
Description: Send Mail Using mail() Function in PHP Timestamp: 2017-10-03 19:51:23 +0000
View raw paste Reply
  1. <?php
  2. // source: http://www.apphp.com/index.php?snippet=php-send-mail-using-mail-function
  3. $to = 'myfriend@gmail.com';
  4. $subject = 'Test Email';
  5. $body = 'Body of your message here. You can use HTML tags also, e.g. <br><b>Bold</b>';
  6. $headers = 'From: John Smith'."\r\n";
  7. $headers .= 'Reply-To: from@email.me'."\r\n";
  8. $headers .= 'Return-Path: from@email.me'."\r\n";
  9. $headers .= 'X-Mailer: PHP5'."\n";
  10. $headers .= 'MIME-Version: 1.0'."\n";
  11. $headers .= 'Content-type: text/html; charset=iso-8859-1'."\r\n";
  12. mail($to, $subject, $body, $headers);
  13. ?>
View raw paste Reply