[SOLVED] Gmail, Authentication, TLS etc

Swift Mailer is a fantastic library for sending email with php. Discuss this library or ask any questions about it here.

Moderators: Chris Corbyn, General Moderators

Post Reply
chuckl
Forum Commoner
Posts: 61
Joined: Wed May 23, 2007 7:36 am

[SOLVED] Gmail, Authentication, TLS etc

Post by chuckl »

I think I must be missing a fundamental point somewhere in all of this, but on both debian and ubuntu servers, whether I use PHP 4 or 5, TLS or SSL, ports 465 or 587; the 3-5 line gmail code snippets in the wiki docs simply generate the following log

++ Enabling logging
>> MAIL FROM:
<< 530 5.5.1 Authentication Required b33sm8684065ika
!! Expected response code(s) [250] but got response [530 5.5.1 Authentication Required b33sm8684065ika]
>> RCPT TO:
<< 530 5.5.1 Authentication Required b33sm8684065ika
!! Expected response code(s) [250] but got response [530 5.5.1 Authentication Required b33sm8684065ika]
>> RSET
<< 250 2.1.0 Flushed b33sm8684065ika

By messing up tls, ssl and the gmail ports, it is also possible to generate a 'failed to start' error.

I have looked through all the gmail threads I could find here, and I have seen several references to the necessity of having openssl compiled in, tantalising glimpses of referrals to tls://, brief flashes of the necessity of tls stream wrappers, etc etc etc.

If I run phpinfo(), it says it has openssl 0.9.8a. Is this the touchstone we seek, and if so, what magic ini file tweaks and command line switches are needed to make it surrender these treasures for use by the community?
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Have you provided your gmail username and password as indicated in the "SMTP Authentication" section of the documentation?
chuckl
Forum Commoner
Posts: 61
Joined: Wed May 23, 2007 7:36 am

Post by chuckl »

The immediate response is 'Of course I have, what does the man think I'm stupid or something?' Don't answer that...

The more rational response as always is to say 'Suspect the obvious and double check it again.'

At which point we can ponder the subtle differences between PHP constants EMAIL_SMTPAUTH_PASSWORD and EMAIL_SMTPAUTH_PASSSWORD.

All does indeed work when the logon password is not NULL. Sometimes I hate implicit declaration.

Rgds,
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Glad to hear it :)
Post Reply