1

I'm getting an EOF error. I'm using the basic template with a few subtractions (attachments, cc, etc) and one addition (AuthType='PLAIN').

<?php
require __DIR__ . '/vendor/autoload.php';

$mail = new PHPMailer;

$mail->SMTPDebug = 4;                               // Enable verbose debug output

$mail->isSMTP();                                      // Set mailer to use SMTP
$mail->Host = 'smtp.zoho.com';  // Specify main and backup SMTP servers
$mail->SMTPAuth = true;                               // Enable SMTP authentication
$mail->AuthType = 'PLAIN';
$mail->Username = '*******';                 // SMTP username
$mail->Password = '*******';                           // SMTP password
$mail->SMTPSecure = 'tls';                         // Enable TLS encryption, `ssl` also accepted
$mail->Port = 587;                                 // TCP port to connect to

$mail->setFrom('*************', '*****');
$mail->addAddress('*********', '******');     // Add a recipient

$mail->isHTML(true);                                  // Set email format to HTML

$mail->Subject = 'From phpmailer-test.php';
$mail->Body    = 'This is the HTML message body <b>in bold!</b>';
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';

if(!$mail->send()) {
     echo 'Message could not be sent.';
     echo 'Mailer Error: ' . $mail->ErrorInfo;
} else {
     echo 'Message has been sent';
}
?>

-I've tried STMP via 465 both with this script and with telnet and gotten the same error.

-I've tested this with tls and 587 with this script (but not telent) and gotten this error.

-I'm using composer, per the Troubleshooting page's instructions.

-Script is at phillyguitarlessons.com, mail account is at *@kalegood.com (hosted by zoho.com). I don't think this would cause an error, but am not sure.

-I've tried looking through the docs (via a page search for "EOF") and found nothing.

-From my VPS, my ports should be wide-open. To zoho.com

-Opensssl is activated (confirmed via info.php)

Output (switched to debug level 2):

2016-10-03 13:47:40 SERVER -> CLIENT: 220 mx.zohomail.com SMTP Server ready October 3, 2016 6:47:40 AM PDT 
2016-10-03 13:47:40 CLIENT -> SERVER: EHLO phillyguitarlessons.com 
2016-10-03 13:47:40 SERVER -> CLIENT: 250-mx.zohomail.com Hello phillyguitarlessons.com (162.243.32.109 (162.243.32.109)) 250-STARTTLS 250 SIZE 53477376 
2016-10-03 13:47:40 CLIENT -> SERVER: STARTTLS 
2016-10-03 13:47:40 SERVER -> CLIENT: 220 Ready to start TLS. 
2016-10-03 13:47:41 CLIENT -> SERVER: EHLO phillyguitarlessons.com 
2016-10-03 13:47:41 SERVER -> CLIENT: 250-mx.zohomail.com Hello phillyguitarlessons.com (162.243.32.109 (162.243.32.109)) 250-AUTH LOGIN PLAIN 250 SIZE 53477376 
2016-10-03 13:47:41 CLIENT -> SERVER: AUTH PLAIN 
2016-10-03 13:49:46 SERVER -> CLIENT: 334 
2016-10-03 13:49:46 SMTP NOTICE: EOF caught while checking if connected 
2016-10-03 13:49:46 SMTP Error: Could not authenticate. 
2016-10-03 13:49:46 SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting Message could not be sent.Mailer Error: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
Synchro
  • 35,538
  • 15
  • 81
  • 104
Kale
  • 55
  • 1
  • 8
  • Any of these answers helpful? http://stackoverflow.com/questions/2227702/php-mailer-error – RigidBody Oct 03 '16 at 13:27
  • Could you set `SMTPDebug = 2` and post the output (4 is too noisy for this) - though make sure not to post your encoded password! – Synchro Oct 03 '16 at 13:27
  • waiting for it to pop up now. I looked through and didn't see it throwing any errors before the EOF (but I did mean to include it and just forgot). – Kale Oct 03 '16 at 13:48
  • That is odd. The 334 response is correct. I'm wondering if it's a quirk of checking for EOF in [`stream_get_meta_data`](http://php.net/manual/en/function.stream-get-meta-data.php) - can you try this: in class.smtp.php in the `connected` method, change this condition: `if ($sock_status['eof']) {` to `if (feof($this->smtp_conn)) {` and see if that helps. – Synchro Oct 03 '16 at 18:22
  • Same error, unfortunately. – Kale Oct 03 '16 at 20:21
  • Any further suggestions, or should I take it up with my mail provider? – Kale Oct 06 '16 at 21:53

0 Answers0