Guest User

Untitled

a guest
Feb 1st, 2019
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. <?php
  2. include ("class.phpmailer.php");
  3. $mail = new PHPMailer();
  4. $mail->IsSMTP(); // set mailer to use SMTP
  5. $mail->Host = "mail.domain.com"; // specify main and backup server
  6. $mail->SMTPAuth = true; // turn on SMTP authentication
  7. $mail->Username = "mailer@domain.com"; // SMTP username
  8. $mail->Password = "PASSWORD"; // SMTP password
  9. $mail->From = "mailer@domain.com"; //do NOT fake header. The Username domain and the from domain must be the same.
  10. $mail->FromName = "GreenLam";
  11. $mail->AddAddress("user1@domain.com"); // Email on which you want to send mail
  12. $mail->AddReplyTo("user1@domain.com", "Support and Help"); //optional
  13. $mail->IsHTML(true);
  14. $mail->Subject = "Contact Us Form";
  15. $mail->Body = "This is a test form";
  16. $mail->SMTPDebug = 1;
  17. if(!$mail->Send())
  18. {
  19. echo $mail->ErrorInfo;
  20. }else{
  21. echo "Thank You for submitting your comments. Our staff will contact you shortly!";
  22. }
  23. ?>
Add Comment
Please, Sign In to add comment