Advertisement
Guest User

Untitled

a guest
Feb 25th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. require("class.phpmailer.php");
  2.  
  3. $mail = new PHPMailer()
  4.  
  5. $mail->From = "sender@gmail.com";
  6. $mail->AddAddress("recipient@gmail.com"); // name is optional
  7. $mail->AddReplyTo("sender@gmail.com");
  8.  
  9. $mail->WordWrap = 50; // set word wrap to 50 characters
  10. $mail->IsHTML(true); // set email format to HTML
  11.  
  12. $mail->Subject = "Here is the subject";
  13. $mail->Body = "This is the HTML message body <b>in bold!</b>";
  14. $mail->AltBody = "This is the body in plain text for non-HTML mail clients";
  15.  
  16. if(!$mail->Send())
  17. {
  18. echo "Message could not be sent. <p>";
  19. echo "Mailer Error: " . $mail->ErrorInfo;
  20. exit;
  21. }
  22.  
  23. echo "Message has been sent";
  24.  
  25. //$mail->IsSMTP(); // is this necessary?
  26. //$mail->Host = "some host ip"; // what i need to write here?
  27. //$mail->SMTPAuth = true; // is this necessary to send email NOT as spam?
  28. //$mail->Username = "test"; // and this?
  29. //$mail->Password = "secret"; // and this?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement