Saturday, November 16, 2013

Setting Up Coldfusion With A G-Mail Account

One does not simply setup G-Mail in Coldfusion

I wanted to setup a mail account on a website i was developing so notifications could be sent out. I tried to configure my G-Mail account in my development environment. Even though my username and password were correct, Coldfusion wasn't able to actually send the e-mails. I had followed the instructions from Google but no dice. After looking through the error logs I found a recurring error message that read:

com.sun.mail.smtp.SMTPSendFailedException: 530 5.7.0 Must issue a STARTTLS command first

It seems that even though the server name, username and password were correct, I needed to enable TLS (and after a few tries I found out you also need to enable SSL) through port 465. That seemed to solve the issue.

In short, when setting up your G-Mail account on the CF Administrator, make sure you specify stmp.gmail.com as the mail server, your full email address as the user name, your password, port 465, and make sure you have both SSL and TLS enabled, like  so:

After this I was finally able to send the e-mails. Boromir would be proud.