Monday, November 17, 2008

ActionMailer with Gmail. Must issue a STARTTLS command first

If you ever tried sending e-mail via ActionMailer with gmail settings you may have received the following error:

530 5.7.0 Must issue a STARTTLS command first. k41sm7289021rvb.4

The problem is that Gmail requires TLS authentication but the standard Ruby net/smtp library doesn't support TLS.

Of course there is a helpful plugin created by Marc Chung to overcome this barrier. You can find it here and manually add it to your project or you can export it to your plugin directory.

$ cd vendor/plugins
$ svn export

Either way make sure you require 'smtp_tls'

Now all you need is to update your smtp_settings if you haven't done so already.

ActionMailer::Base.smtp_settings = {
:address => "",
:port => 587,
:domain => "",
:user_name => "",
:password => "password",
:authentication => :plain

You can now enjoy the benefits of a free email server.


Unknown said...

Thanks for the article. However, I'm still a little confused. Shouldn't the domain and password be and valid gmail account, respectively? Or does this refer to something else?

Unknown said...

I believe is no longer available. Do you have the URL to the new location?

Francisco Riveros said...

that is the new url of the plugin ;)
best Regards

Anonymous said...

Divorce Records Birth records by state

cialis online said...

cialis online

Anonymous said...

Free Arrest Records Search

Dominican Vital Records said...

I recently came across your blog and have been reading the superlative contents on your blogs, thanks for sharing here and if anyone looking for dominican republic birth records then visit