Advertisement
Guest User

Untitled

a guest
Feb 29th, 2016
290
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.99 KB | None | 0 0
  1. Notice
  2. SMTP Error: data not accepted.
  3.  
  4. Send Mail: Yes
  5. Mailer: SMTP
  6. From email: bluemonkmn@sgdk2.enigmadream.com
  7. From name: Benjamin Marty
  8. Disable Mass Mail: No
  9. SMTP Authentication: Yes
  10. SMTP Security: None
  11. SMTP Port: 25
  12. SMTP Username: bluemonkmn@sgdk2.enigmadream.com
  13. SMTP Password: (same password I used in the script below)
  14. SMTP Host: mail.sgdk2.enigmadream.com
  15.  
  16. <?php
  17. /**
  18. * This example shows making an SMTP connection with authentication.
  19. */
  20.  
  21. //SMTP needs accurate times, and the PHP timezone MUST be set
  22. //This should be done in your php.ini, but this is how to do it if you don't have access to that
  23. date_default_timezone_set('Etc/UTC');
  24.  
  25. require 'PHPMailerAutoload.php';
  26. //Create a new PHPMailer instance
  27. $mail = new PHPMailer;
  28.  
  29. //Tell PHPMailer to use SMTP
  30. $mail->isSMTP();
  31. //Enable SMTP debugging
  32. // 0 = off (for production use)
  33. // 1 = client messages
  34. // 2 = client and server messages
  35. $mail->SMTPDebug = 2;
  36. //Ask for HTML-friendly debug output
  37. $mail->Debugoutput = 'html';
  38.  
  39. //Set the hostname of the mail server
  40. $mail->Host = "mail.sgdk2.enigmadream.com";
  41. //Set the SMTP port number - likely to be 25, 465 or 587
  42. $mail->Port = 25;
  43. //Whether to use SMTP authentication
  44. $mail->SMTPAuth = true;
  45. //Username to use for SMTP authentication
  46. $mail->Username = "bluemonkmn@sgdk2.enigmadream.com";
  47. //Password to use for SMTP authentication
  48. $mail->Password = "See Comment"; // I used the same password configured above
  49. //Set who the message is to be sent from
  50. $mail->setFrom('bluemonkmn@sgdk2.enigmadream.com', 'Benjamin Marty');
  51. //Set an alternative reply-to address
  52. $mail->addReplyTo('bluemonkmn@sgdk2.enigmadream.com', 'Benjamin Marty');
  53. //Set who the message is to be sent to
  54. $mail->addAddress('bluemonkmn@outlook.com', 'Ben Marty');
  55.  
  56. //Set the subject line
  57. $mail->Subject = 'PHPMailer SMTP test';
  58. //if you want to include text in the body.
  59. $mail->Body = "This is a test of email";
  60.  
  61. //send the message, check for errors
  62. if (!$mail->send()) {
  63. echo "Mailer Error: " . $mail->ErrorInfo;
  64. } else {
  65. echo "Message sent!";
  66. }
  67. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement