Advertisement
Guest User

Untitled

a guest
Oct 18th, 2018
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.86 KB | None | 0 0
  1. <?php
  2.  
  3.  
  4. // $email and $message are the data that is being
  5. // posted to this page from our html contact form
  6. $email = $_REQUEST['email'] ;
  7. $message = $_REQUEST['message'] ;
  8.  
  9. // When we unzipped PHPMailer, it unzipped to
  10. // public_html/PHPMailer_5.2.0
  11. require "/3w/euweb.cz/t/testdomena2018/PHPMailerAutoload.php";
  12.  
  13. $mail = new PHPMailer();
  14.  
  15. // set mailer to use SMTP
  16. $mail->IsSMTP();
  17.  
  18. // As this email.php script lives on the same server as our email server
  19. // we are setting the HOST to localhost
  20. $mail->Host = "testdomena2018@gmail.com"; // specify main and backup server
  21.  
  22. $mail->SMTPAuth = true; // turn on SMTP authentication
  23.  
  24. // When sending email using PHPMailer, you need to send from a valid email address
  25. // In this case, we setup a test email account with the following credentials:
  26. // email: send_from_PHPMailer@bradm.inmotiontesting.com
  27. // pass: password
  28. $mail->Username = "testdomena2018@gmail.com"; // SMTP username
  29. $mail->Password = "Mjdh1512"; // SMTP password
  30.  
  31. // $email is the user's email address the specified
  32. // on our contact us page. We set this variable at
  33. // the top of this page with:
  34. // $email = $_REQUEST['email'] ;
  35. $mail->From = $email;
  36.  
  37. // below we want to set the email address we will be sending our email to.
  38. $mail->AddAddress ("martinkostelka@gmail.com");
  39.  
  40. // set word wrap to 50 characters
  41. $mail->WordWrap = 50;
  42. // set email format to HTML
  43. $mail->IsHTML(true);
  44.  
  45. $mail->Subject = "You have received feedback from your website!";
  46.  
  47. // $message is the user's message they typed in
  48. // on our contact us page. We set this variable at
  49. // the top of this page with:
  50. // $message = $_REQUEST['message'] ;
  51. $mail->Body = $message;
  52. $mail->AltBody = $message;
  53.  
  54. if(!$mail->Send())
  55. {
  56. echo "Message could not be sent.
  57.  
  58. ";
  59. echo "Mailer Error: " . $mail->ErrorInfo;
  60. exit;
  61. }
  62.  
  63. echo "Message has been sent";
  64. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement