views:

796

answers:

3

I've just switched an application to use ar_mailer and when I run ar_sendmail (after a long pause) I get the following error:

Unhandled exception 530 5.7.0 Must issue a STARTTLS command first. h7sm16260325nfh.4

I am using Gmail SMTP to send the emails and I haven't changed any of the ActionMailer::Base.smtp_settings just installed ar_mailer.

Versions:

Rails: 2.1, ar_mailer: 1.3.1

A: 

What version of ar_mailer are you using? A gmail specific bug was fixed in 1.3.1, as shown here:

http://rubyforge.org/forum/forum.php?forum_id=16364

workmad3
+1  A: 

Did some digging in the lib and it seems that if you want to use TLS (as you do with Gmail) then it adds a new option to the ActionMailer::Base.smtp_settings of :tls (default of which is false) which you should set to true.

The only thing the installation instructions mention regarding TLS is to remove any other smtp_tls files, but the one I had didn't require the tls option to work.

DEfusion
+1  A: 

Maybe you use the ruby version 1.8.7

You dont need the smtp_tls before

just need add the enable_startls_auto option

ActionMailer::Base.smtp_settings = { :enable_starttls_auto => true, ... ... }