Using your Gmail account for sending automated SMTP emails

Blogging just tad short of a full year, oh well...

Anyways, I today came back to the admin section of my website after a loooong time and noticed automated email alerts from the site (for example comment notification emails) have been failing for sometime. The site uses a Google Apps account to dispatch emails, and I din't thought anything had changed on the account for smtp email delivery from the site to fail.

I tried sending a test email and got this error in my site logs (email addresses changed for obvious reasons):

Error sending e-mail from test@example.com to test2@example.com : SMTP Error: Could not authenticate.

Hmmmm.. the password hadn't changed though.

Anyways, I was aware Google had changed/enhanced its security settings over the last year and we had to configure something on a client installation a few months back to enable smtp email delivery from the client's site (the client again using Google Apps). I logged into the Google account used for email delivery and after some playing around, figured I needed to enable the following option to enable smtp email delivery from my site using a gmail account:

"Allow less secure apps"

Here are the steps to precisely reach this setting currently as this blog post is being written (Google tends to regularly update the options available under "Sign-in and Security" section of your Google account):

  1. Login to your Google Account and click "My Account" from the drop-down on the top-right corner.
  2. Click "Connected Apps & Sites" under the "Sign-in & Security" section.

    Google Account Settings
  3. Finally ensure the "Allow less secure apps" option is set to "ON".

     Allowing less secure apps

That's pretty much it, hopefully this helps some soul.

 

Tags: 

Comments

rahul's picture

Hi Akshat,

Google does not allow Gmail hosted emails to be used for bulk email purposes. I am not aware of some hard-coded limit but I have seen people reporting issues trying to send too many emails or including too many receipients when sending from a Google email account (including gmail and google apps accounts).

amazing blog, Thanks for sharing.