Guest User

Untitled

a guest
Sep 25th, 2017
65
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. $subject = "Contact Form";
  12.  
  13. $message = "
  14. <html>
  15. <head>
  16. <title>HTML email</title>
  17. </head>
  18. <body>
  19. <h1 style='padding:5px; background-color:#fff; border:1px dotted #0cf; margin-bottom:5px; width:800px; font-size:16px'>Academic Food Contact Form</h1>
  20. <h4 style='padding:5px; background-color:#fff; border:1px dotted #0cf; margin-bottom:5px; width:800px; font-size:14px;'>Name-Surname: $fullname</h4></br>
  21. <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>
  22. <h5 style='padding:5px; background-color:#fff; border:1px dotted #0cf; margin-bottom:5px; width:800px; font-size:14px;'>Your Message: $message</h5>
  23.  
  24. </body>
  25. </html>
  26. ";
  27.  
  28. // Always set content-type when sending HTML email
  29. $headers = "MIME-Version: 1.0" . "\r\n";
  30. $headers .= "Content-type:text/html;charset=utf-8" . "\r\n";
  31.  
  32. // More headers
  33. $headers .= 'From: ('.$fullname.')'.$emailaddress . "\r\n";
  34.  
  35.  
  36. mail($to,$subject,$message,$headers);
  37.  
  38. echo "<font color=blue>Received your message</font>";
  39. ?>
Advertisement
Add Comment
Please, Sign In to add comment