Flourish PHP Unframework
This is an archived copy of the forum for reference purposes

fSMTP problem

posted by johnnydeep 8 years ago

Hi! When I'm trying to send an email using the fSMTP class I got this error and I don't know what it mean:

Fatal error: Uncaught exception 'fConnectivityException' with message 'Unknown SMTP welcome message, 554 server.com, from server smtp.server.com on port 25' in fSMTP.php:235 Stack trace: 

#0 fSMTP.php(529): fSMTP->connect() 
#1 fEmail.php(1347): fSMTP->send('myemail@server.com', Array, 'To: "John" <j...', 'This is the bod...') 
#2 test.php(20): fEmail->send(Object(fSMTP)) 
#3 {main} thrown in fSMTP.php on line 235

The server reject the connection? Any clue? Thanks in advanced.

It sounds like the SMTP server is broken, or configured to not let you use it. An SMTP server should respond upon connection with 220 example.com, whereas a 554 response means "Transaction failed."

posted by wbond 8 years ago

@wbond and @johnnydeep

This was the same error I was receiving on windows with regards to the following bug: http://flourishlib.com/ticket/566

What version of PHP are you running johnnydeep, and are you on Windows by any chance?

posted by mattsah 8 years ago

@wbond the SMTP it's working fine, I can send emails using Outlook.

@msahagian I'm running XAMPP in Windows NT and PHP 5.3.5

Thanks!

posted by johnnydeep 8 years ago

@johnnydeep

At the very least make the change I indicated in that ticket. If you don't it is likely that your system will send an invalidly formatted hostname to the mail server with the EHLO command -- with that said though your welcome message should look something similar to:

220 providence.dotink.org ESMTP Postfix (Debian/GNU)

Can you telnet into your SMTP server and paste the initial output from the server? When I was debugging I also modified the read() and write() methods on fSMTP to echo what was being read/written -- this helped gratefully in seeing the dialogue that was occurring between Flourish and the SMTP server, so it could likely help you.

The welcome message should look pretty similar to the above. Out of curiosity as well, what software is running the SMTP server? Does it require SSL off the bat?

posted by mattsah 8 years ago

Also note that there is fSMTP::enableDebugging() which will print all data to and from the SMTP server.

posted by wbond 8 years ago

The fix doesn't work for me. I dont have access because it's a production environment, I run the lastest version of flourish and give me

Fatal error: Uncaught exception 'fConnectivityException' with message 'Unknown SMTP welcome message, 554 cinmlip01.e2k.ad.xxx.com, from server smtp.ar.server.xxx.com on port 25' in
lib
fSMTP.php:235 Stack trace: #0

Should I use another library to send emails?

posted by johnnydeep 8 years ago

I would recommend calling fSMTP::enableDebugging() with the parameter TRUE on your fSMTP instance and see what messages are being sent back and forth between your site and the server. If you can paste the output of that, I should be able to help.

$smtp = new fSMTP('server');
$smtp->enableDebugging(TRUE);
$email->send($smtp);
posted by wbond 8 years ago