Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2015
564
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.19 KB | None | 0 0
  1. <?php
  2.  
  3. require './PHPMailer/PHPMailerAutoload.php';
  4.  
  5. $mail = new PHPMailer;
  6.  
  7. $mail->isSMTP();
  8.  
  9. $mail->SMTPDebug = 4;
  10.  
  11. $mail->Debugoutput = 'html';
  12.  
  13. $mail->Host = "localhost";
  14. //Set the SMTP port number - likely to be 25, 465 or 587
  15. $mail->Port = 25;
  16.  
  17. $mail->SMTPAuth = true;
  18.  
  19. $mail->Username = "donotreply@myservermail";
  20.  
  21. $mail->Password = "mypassword";
  22.  
  23. $mail->setFrom('donotreply@myservermail', 'Mail test');
  24.  
  25. $mail->addReplyTo('myemail@live.com', 'First Last');
  26.  
  27. $mail->addAddress('donotreply@myservermail', 'Test mail');
  28.  
  29. $mail->Subject = 'PHPMailer SMTP test';
  30.  
  31.  
  32. $mail->msg = 'Hello there this is a test . ';
  33.  
  34. $mail->Body = 'This is a plain-text message body';
  35.  
  36. if (!$mail->send()) {
  37. echo "Mailer Error: " . $mail->ErrorInfo;
  38. } else {
  39. echo "Message sent!";
  40. }
  41.  
  42. ?>
  43.  
  44. Connection: opening to localhost:25, timeout=300, options=array ()
  45. Connection: opened
  46. SMTP -> get_lines(): $data was ""
  47. SMTP -> get_lines(): $str is "220 localhost ESMTP"
  48. SMTP -> get_lines(): $data is "220 localhost ESMTP"
  49. SERVER -> CLIENT: 220 localhost ESMTP
  50. CLIENT -> SERVER: EHLO MY_SERVER_NAME
  51. SMTP -> get_lines(): $data was ""
  52. SMTP -> get_lines(): $str is "250-localhost"
  53. SMTP -> get_lines(): $data is "250-localhost"
  54. SMTP -> get_lines(): $data was "250-localhost"
  55. SMTP -> get_lines(): $str is "250-SIZE 20480000"
  56. SMTP -> get_lines(): $data is "250-localhost250-SIZE 20480000"
  57. SMTP -> get_lines(): $data was "250-localhost250-SIZE 20480000"
  58. SMTP -> get_lines(): $str is "250-AUTH LOGIN"
  59. SMTP -> get_lines(): $data is "250-localhost250-SIZE 20480000250-AUTH LOGIN"
  60. SMTP -> get_lines(): $data was "250-localhost250-SIZE 20480000250-AUTH LOGIN"
  61. SMTP -> get_lines(): $str is "250 HELP"
  62. SMTP -> get_lines(): $data is "250-localhost250-SIZE 20480000250-AUTH LOGIN250 HELP"
  63. SERVER -> CLIENT: 250-localhost250-SIZE 20480000250-AUTH LOGIN250 HELP
  64. Auth method requested: UNKNOWN
  65. Auth methods available on the server: LOGIN
  66. Auth method selected: LOGIN
  67. CLIENT -> SERVER: AUTH LOGIN
  68. SMTP -> get_lines(): $data was ""
  69. SMTP -> get_lines(): $str is "334 SOME_ENCRYPTED_STRING"
  70. SMTP -> get_lines(): $data is "334 SOME_ENCRYPTED_STRING"
  71. SERVER -> CLIENT: 334 SOME_ENCRYPTED_STRING
  72. CLIENT -> SERVER: SOME_ENCRYPTED_STRING
  73. SMTP -> get_lines(): $data was ""
  74. SMTP -> get_lines(): $str is "334 SOME_ENCRYPTED_STRING"
  75. SMTP -> get_lines(): $data is "334 SOME_ENCRYPTED_STRING"
  76. SERVER -> CLIENT: 334 SOME_ENCRYPTED_STRING
  77. CLIENT -> SERVER: SOME_ENCRYPTED_STRING
  78. SMTP -> get_lines(): $data was ""
  79. SMTP -> get_lines(): $str is "235 authenticated."
  80. SMTP -> get_lines(): $data is "235 authenticated."
  81. SERVER -> CLIENT: 235 authenticated.
  82. CLIENT -> SERVER: MAIL FROM:<donotreply@MY_SERVER_MAIL>
  83. SMTP -> get_lines(): $data was ""
  84. SMTP -> get_lines(): $str is "250 OK"
  85. SMTP -> get_lines(): $data is "250 OK"
  86. SERVER -> CLIENT: 250 OK
  87. CLIENT -> SERVER: RCPT TO:<MY_EMAIL@yahoo.com>
  88. SMTP -> get_lines(): $data was ""
  89. SMTP -> get_lines(): $str is "250 OK"
  90. SMTP -> get_lines(): $data is "250 OK"
  91. SERVER -> CLIENT: 250 OK
  92. CLIENT -> SERVER: DATA
  93. SMTP -> get_lines(): $data was ""
  94. SMTP -> get_lines(): $str is "354 OK, send."
  95. SMTP -> get_lines(): $data is "354 OK, send."
  96. SERVER -> CLIENT: 354 OK, send.
  97. CLIENT -> SERVER: Date: Thu, 14 May 2015 10:40:00 +0200
  98. CLIENT -> SERVER: To: MY_EMAIL yahoo <MY_EMAIL@yahoo.com>
  99. CLIENT -> SERVER: From: MAIL_SERVER test <donotreply@MY_SERVER_MAIL>
  100. CLIENT -> SERVER: Reply-To: MY_EMAIL Live <MY_EMAIL@live.com>
  101. CLIENT -> SERVER: Subject: PHPMailer SMTP test
  102. CLIENT -> SERVER: Message-ID: <SOME_ENCRYPED_STRING@MY_SERVER_NAME>
  103. CLIENT -> SERVER: X-Priority: 3
  104. CLIENT -> SERVER: X-Mailer: PHPMailer 5.2.10 (https://github.com/PHPMailer/PHPMailer/)
  105. CLIENT -> SERVER: MIME-Version: 1.0
  106. CLIENT -> SERVER: Content-Type: text/plain; charset=iso-8859-1
  107. CLIENT -> SERVER: Content-Transfer-Encoding: 8bit
  108. CLIENT -> SERVER:
  109. CLIENT -> SERVER: This is a plain-text message body
  110. CLIENT -> SERVER:
  111. CLIENT -> SERVER: .
  112. SMTP -> get_lines(): $data was ""
  113. SMTP -> get_lines(): $str is "250 Queued (0.000 seconds)"
  114. SMTP -> get_lines(): $data is "250 Queued (0.000 seconds)"
  115. SERVER -> CLIENT: 250 Queued (0.000 seconds)
  116. CLIENT -> SERVER: QUIT
  117. SMTP -> get_lines(): $data was ""
  118. SMTP -> get_lines(): $str is "221 goodbye"
  119. SMTP -> get_lines(): $data is "221 goodbye"
  120. SERVER -> CLIENT: 221 goodbye
  121. Connection: closed
  122. Message sent!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement