Advertisement
Guest User

Untitled

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