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. $from = $_POST['email'];
  7.  
  8.  
  9. //data
  10. $msg = "NAME: " .$_POST['name'] ."<br>\n";
  11. $msg .= "EMAIL: " .$_POST['email'] ."<br>\n";
  12. $msg .= "WEBSITE: " .$_POST['web'] ."<br>\n";
  13. $msg .= "COMMENTS: " .$_POST['comments'] ."<br>\n";
  14.  
  15. //Headers
  16. $headers = "MIME-Version: 1.0
  17. ";
  18. $headers .= "Content-type: text/html; charset=UTF-8
  19. ";
  20. $headers .= "From: <".$from. ">" ;
  21.  
  22.  
  23. //send
  24. mail($to, $subject, $msg, $headers);
  25. ?>

Report this snippet  

You need to login to post a comment.