Posted By

ricosushi on 07/14/10


Tagged

email mail send sendmail


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

ricosushi


Send mail


 / Published in: PHP
 

Sends mail

  1. <?php
  2. // send the form to the specify email
  3.  
  4. // CONFIG VARS
  5. $subject = "Watercolor website | contact form";
  6. $to = "[email protected]";
  7. $from = $_POST['email'];
  8.  
  9.  
  10. //data
  11. $msg = "NAME: " .$_POST['name'] ."<br>\n";
  12. $msg .= "EMAIL: " .$_POST['email'] ."<br>\n";
  13. $msg .= "WEBSITE: " .$_POST['web'] ."<br>\n";
  14. $msg .= "COMMENTS: " .$_POST['comments'] ."<br>\n";
  15.  
  16. //Headers
  17. $headers = "MIME-Version: 1.0
  18. ";
  19. $headers .= "Content-type: text/html; charset=UTF-8
  20. ";
  21. $headers .= "From: <".$from. ">" ;
  22.  
  23.  
  24. //send
  25. mail($to, $subject, $msg, $headers);
  26. ?>

Report this snippet  

You need to login to post a comment.