mail.php 766 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. // Put here your valid email address
  3. $to = "dv.fortier@gmail.com";
  4. // Subject of the message
  5. $subject = "Test mail() function of PHP";
  6. // Body of the message, text encoded using iso-8859-1
  7. $message = "Hello,\nthe message was send. Regards the Webmaster\n";
  8. // Headers of the message
  9. $headers = ""; // we clear the variable
  10. $headers = "From: Postmaster <postmaster@ipsocloud.com>\n"; // Adding the From field
  11. // $headers = $headers."MIME-Version: 1.0\n"; // Adding the MIME version
  12. $headers = $headers."Content-type: text/plain; charset=iso-8859-1\n"; // Add the type of encoding
  13. // Call the mail function
  14. if ( mail($to, $subject, $message, $headers) == TRUE )
  15. {
  16. echo "Mail sent.";
  17. }
  18. else
  19. {
  20. echo "Error: The message could not be sent.";
  21. }
  22. ?>