Guest User

Untitled

a guest
Apr 22nd, 2018
378
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.46 KB | None | 0 0
  1. <?php
  2. // Import PHPMailer classes into the global namespace
  3. // These must be at the top of your script, not inside a function
  4. use PHPMailerPHPMailerPHPMailer;
  5. use PHPMailerPHPMailerException;
  6.  
  7. //Load Composer's autoloader
  8. require 'vendor/autoload.php';
  9.  
  10. $mail = new PHPMailer(true); // Passing `true` enables exceptions
  11. try {
  12. //Server settings
  13. $mail->SMTPDebug = 2; // Enable verbose debug output
  14. $mail->isSMTP(); // Set mailer to use SMTP
  15. $mail->Host = 'smtp.aol.com'; // Specify main and backup SMTP servers
  16. $mail->SMTPAuth = true; // Enable SMTP authentication
  17. $mail->Username = 'xxxxxxxxxxxxxxxxxxx@aol.com'; // SMTP username
  18. $mail->Password = 'yyyyyyyyyyyyyyyyyyyyyy'; // SMTP password
  19. $mail->SMTPSecure = 'ssl'; // Enable TLS encryption, `ssl` also accepted
  20. $mail->Port = 465; // TCP port to connect to
  21.  
  22. //Recipients
  23. $mail->setFrom('xxxxxxxxxxxxxxxxxxx@aol.com', 'Barry AOL');
  24. $mail->addAddress('xxxxxxxxxxxxxxxxxxx@gmail.com', 'Barry gmail'); // Add a recipient
  25. //Content
  26. $mail->isHTML(true); // Set email format to HTML
  27. $mail->Subject = 'Here is the subject - sent from AOL.com ';
  28. $mail->Body = 'This is the HTML message body <b>in bold!</b> - sent from AOL.com ';
  29. $mail->AltBody = 'This is the body in plain text for non-HTML mail clients - sent from AOL.com ';
  30.  
  31. $mail->send();
  32. echo 'Message has been sent from AOL.com ';
  33. } catch (Exception $e) {
  34. echo 'Message could not be sent. Mailer Error: ', $mail->ErrorInfo;
  35. }
  36.  
  37. 2018-04-22 21:44:56 SERVER -> CLIENT: 521 5.2.1 : AOL will not accept delivery of this message.
  38. 2018-04-22 21:44:56 SMTP ERROR: DATA END command failed: 521 5.2.1 : AOL will not accept delivery of this message.
  39. SMTP Error: data not accepted.
  40. Message could not be sent. Mailer Error: SMTP Error: data not accepted.SMTP server error: DATA END command failed Detail: : AOL will not accept delivery of this message. SMTP code: 521 Additional SMTP info: 5.2.12018-04-22 21:44:56 CLIENT -> SERVER: QUIT
  41. 2018-04-22 21:44:56 SERVER -> CLIENT:
  42. 2018-04-22 21:44:56 SMTP ERROR: QUIT command failed:
Add Comment
Please, Sign In to add comment