Advertisement
Guest User

Untitled

a guest
Mar 16th, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. <?php
  2. require_once('../class.phpmailer.php');
  3. //include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded
  4.  
  5. try {
  6. $mail = new PHPMailer();
  7. $mail->Host = "relay-hosting.secureserver.net"; // your SMTP Server
  8. $mail->IsSMTP();
  9. $mail->SMTPDebug = true;
  10. $mail->SMTPAuth = false; // Auth Type
  11. $mail->SMTPSecure = "ssl";
  12. $mail->Username = "email@mydomain.com";
  13. $mail->Password = "password";
  14. $mail->Sender = "email@mydomain.com";
  15. $mail->From = "email@mydomain.com";
  16. $mail->AddReplyTo("email@mydomain.com");
  17. $mail->FromName = "myname";
  18. $mail->AddAddress("email@mydomain.com");
  19. //$mail->AddAddress("desired recipient no.2 optional");
  20. $mail->IsHTML(true);
  21. $mail->Subject = "Test Email";
  22. $mail->Body = "The email was successfully sent!";
  23. $mail->WordWrap = 50;
  24. $mail->Send();
  25. echo"<script>alert('The Form has been posted ,Thank you');window.location='index.html'</script>";
  26. } catch (phpmailerException $e) {
  27. echo $e->errorMessage(); //Pretty error messages from PHPMailer
  28. } catch (Exception $e) {
  29. echo $e->getMessage(); //Boring error messages from anything else!
  30. }
  31. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement