SMTP appears to be malfunctioning

1,171 views
Skip to first unread message

mrryanjohnston

unread,
Sep 4, 2012, 7:44:58 PM9/4/12
to f3-fra...@googlegroups.com
I have tried the code included on the f3 documentation for sending mail via an SMTP server. I have tried this against both Gmail and Yahoo!. It appears that in both cases, the username is being sent too early. I believe this is the case because after the username is sent via ->dialog(), the response from the server requests a username (334 VXNlcm5hbWU6). In response, f3's smtp sends the encoded password. Assuming that this is the username, the server then responds, requesting a password (334 UGFzc3dvcmQ6). At this point, the smtp class for f3 attempts to start sending the email, to which the server reseponds negatively.

Here are snippets of the conversation with the yahoo smtp server (I replaced the encoded strings with the string "base64encodedstring:"

AUTH LOGIN
250 8BITMIME
base64encodedstring
334 VXNlcm5hbWU6
base64encodedstring
334 UGFzc3dvcmQ6
MAIL FROM: <m...@mydomain.com>
530 Access denied

Google's response is a bit stranger:

AUTH LOGIN
250-8BITMIME
250-AUTH LOGIN PLAIN XOAUTH
250-ENHANCEDSTATUSCODES
250 PIPELINING
base64encodedstring
334 VXNlcm5hbWU6
base64encodedstring
334 UGFzc3dvcmQ6
MAIL FROM: <m...@mydomain.com>
501 5.5.2 Cannot Decode response lb1sm50197pbc.47

These are the results of using correct credentials. When using incorrect credentials, a different error occurs, which could shoot my theory as to what's going wrong down.

mrryanjohnston

unread,
Sep 5, 2012, 1:48:29 PM9/5/12
to f3-fra...@googlegroups.com
Update: It would appear to be some sort of gmail-specific malfunction; I re-tested with yahoo again today using this code and was successful:

$mail = new \SMTP('smtp.mail.yahoo.com',465,'SSL',$user,$pass);                                                                      
$mail->set('to','<'.$email.'>');                                                                                             
$mail->set('from','<myemail...@yahoo.com>');                                                                                     
$mail->set('subject','Welcome');                                                                                                     
$mail->send('test');

Note: 'to' must come before 'from' for yahoo, contrary to current f3 documentation which lists from as first. The "From" must also be a valid yahoo email address.
Reply all
Reply to author
Forward
0 new messages