Advertisement
Guest User

Untitled

a guest
Sep 27th, 2018
1,135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1.  
  2. require 'phpmailer/PHPMailerAutoload.php';
  3.  
  4. $mail = new PHPMailer();
  5.  
  6. try {
  7. $mail = new PHPMailer(); //New instance, with exceptions enabled
  8. $mail->IsSMTP(); // tell the class to use SMTP
  9. $mail->SMTPAuth = true; // enable SMTP authentication
  10. $mail->SMTPSecure = ssl; // enable SMTP authentication
  11. $mail->Port = 465; // set the SMTP server port
  12. $mail->Host = "mail.gmail.com"; // SMTP server
  13. $mail->Username = "elbidanisaid@gmail.com"; // SMTP server username
  14. $mail->Password = "Soukainazwina91"; // SMTP server password
  15.  
  16. $mail->IsSendmail(); // tell the class to use Sendmail
  17.  
  18. $mail->AddReplyTo("elbidanisaid@gmail.com","First Last");
  19.  
  20. $mail->From = "elbidanisaid@gmail.com";
  21. $mail->FromName = "First Last";
  22.  
  23. $mail->AddAddress("r1_said@hotmail.fr");
  24.  
  25. $mail->Subject = "First PHPMailer Message";
  26.  
  27. $mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
  28. $mail->WordWrap = 80; // set word wrap
  29.  
  30. $mail->MsgHTML("bonjour<br> said");
  31.  
  32. $mail->IsHTML(true); // send as HTML
  33.  
  34. $mail->Send();
  35. echo 'Message has been sent.';
  36. } catch (phpmailerException $e) {
  37. echo $e->errorMessage();
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement