The short short version is that setting auth to true causes a TLS error. Turning it off allows me to send email, but only to OUR domain. As soon as I set a recipient to an external domain (GMail for example), it gives a relay denied error. Here is a snippet of my code (sanitized):
Code: Select all
$emailbody = "email message here";
$emailfrom = 'account username hosted on NFO servers here';
$emailsubject = "email subject here";
$emailto = 'recipient addresses here';
$recipients = $emailto;
$emailpassword = "email password here";
$emailhost = "mail.nfoservers.com";
$emailheaders['From'] = $emailfrom;
$emailheaders['To'] = $emailto;
$emailheaders['Subject'] = $emailsubject;
$smtpinfo["host"] = $emailhost;
$smtpinfo["port"] = "25";
$smtpinfo["auth"] = true;
$smtpinfo["debug"] = true;
$smtpinfo["username"] = $emailfrom;
$smtpinfo["password"] = $emailpassword;
$smtp =& Mail::factory('smtp', $smtpinfo);
$mailresponse = $smtp->send($recipients, $emailheaders, $emailbody);
Code: Select all
DEBUG: Recv: 220 mail.nuclearfallout.net ESMTP Postfix
DEBUG: Send: EHLO localhost
DEBUG: Recv: 250-mail.nuclearfallout.net
DEBUG: Recv: 250-PIPELINING
DEBUG: Recv: 250-SIZE 100000000
DEBUG: Recv: 250-VRFY
DEBUG: Recv: 250-ETRN
DEBUG: Recv: 250-STARTTLS
DEBUG: Recv: 250-AUTH LOGIN PLAIN
DEBUG: Recv: 250-AUTH=LOGIN PLAIN
DEBUG: Recv: 250-ENHANCEDSTATUSCODES
DEBUG: Recv: 250-8BITMIME
DEBUG: Recv: 250 DSN
DEBUG: Send: STARTTLS
DEBUG: Recv: 454 4.7.0 TLS not available due to local problem
DEBUG: Send: RSET
DEBUG: Recv: 250 2.0.0 Ok
Code: Select all
DEBUG: Recv: 220 mail.nuclearfallout.net ESMTP Postfix
DEBUG: Send: EHLO localhost
DEBUG: Recv: 250-mail.nuclearfallout.net
DEBUG: Recv: 250-PIPELINING
DEBUG: Recv: 250-SIZE 100000000
DEBUG: Recv: 250-VRFY
DEBUG: Recv: 250-ETRN
DEBUG: Recv: 250-STARTTLS
DEBUG: Recv: 250-AUTH LOGIN PLAIN
DEBUG: Recv: 250-AUTH=LOGIN PLAIN
DEBUG: Recv: 250-ENHANCEDSTATUSCODES
DEBUG: Recv: 250-8BITMIME
DEBUG: Recv: 250 DSN
DEBUG: Send: MAIL FROM:<mynfoaccount@mydomain.com>
DEBUG: Recv: 250 2.1.0 Ok
DEBUG: Send: RCPT TO:<myemailaddress@gmail.com>
DEBUG: Recv: 554 5.7.1 <myemailaddress@gmail.com>: Relay access denied
DEBUG: Send: RSET
DEBUG: Recv: 250 2.0.0 Ok
Code: Select all
DEBUG: Recv: 220 mail.nuclearfallout.net ESMTP Postfix
DEBUG: Send: EHLO localhost
DEBUG: Recv: 250-mail.nuclearfallout.net
DEBUG: Recv: 250-PIPELINING
DEBUG: Recv: 250-SIZE 100000000
DEBUG: Recv: 250-VRFY
DEBUG: Recv: 250-ETRN
DEBUG: Recv: 250-STARTTLS
DEBUG: Recv: 250-AUTH LOGIN PLAIN
DEBUG: Recv: 250-AUTH=LOGIN PLAIN
DEBUG: Recv: 250-ENHANCEDSTATUSCODES
DEBUG: Recv: 250-8BITMIME
DEBUG: Recv: 250 DSN
DEBUG: Send: MAIL FROM:<mynfoaccount@mydomain.com>
DEBUG: Recv: 250 2.1.0 Ok
DEBUG: Send: RCPT TO:<mynfoaccount@mydomain.com>
DEBUG: Recv: 250 2.1.5 Ok
DEBUG: Send: DATA
DEBUG: Recv: 354 End data with <CR><LF>.<CR><LF>
DEBUG: Send: From: mynfoaccount@mydomain.com
To: mynfoaccount@mydomain.com
Subject: my email subject
My email message here
.
DEBUG: Recv: 250 2.0.0 Ok: queued as EA8AE5E245
DEBUG: Send: QUIT
DEBUG: Recv: 221 2.0.0 Bye