Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
379
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.30 KB | None | 0 0
  1.  
  2. Tayfun, kodlar aşağıdaki gibi
  3.  
  4. <?php
  5.  
  6.  
  7. $fullname=trim($_POST["fullname"]);
  8. $emailaddress=trim($_POST["emailaddress"]);
  9. $message=trim($_POST["message"]);
  10.  
  11.  
  12. $to = "mustafa_904409@yahoo.com, mustafamalatya@gmail.com";
  13. $subject = "Academic Food Contact Form";
  14.  
  15. $message = "
  16. <html>
  17. <head>
  18. <title>HTML email</title>
  19. </head>
  20. <body>
  21. <h1 style='padding:5px; background-color:#fff; border:1px dotted #0cf; margin-bottom:5px; width:800px; font-size:16px'>Academic Food Contact Form</h1>
  22. <h4 style='padding:5px; background-color:#fff; border:1px dotted #0cf; margin-bottom:5px; width:800px; font-size:14px;'>Name-Surname: $fullname</h4></br>
  23. <h4 style='padding:5px; background-color:#fff; border:1px dotted #0cf; margin-bottom:5px; width:800px; font-size:14px;'>E-mail Address: $emailaddress</h4></br>
  24. <h5 style='padding:5px; background-color:#fff; border:1px dotted #0cf; margin-bottom:5px; width:800px; font-size:14px;'>Your Message: $message</h5>
  25.  
  26. </body>
  27. </html>
  28. ";
  29.  
  30. // Always set content-type when sending HTML email
  31. $headers = "MIME-Version: 1.0" . "\r\n";
  32. $headers .= "Content-type:text/html;charset=utf-8" . "\r\n";
  33.  
  34. // More headers
  35. $headers .= 'From: ('.$fullname.')'.$emailaddress . "\r\n";
  36.  
  37.  
  38. mail($to,$subject,$message,$headers);
  39.  
  40. echo "<font color=blue>Received your message</font>";
  41. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement