Rails ar_mailer fails to send emails

1.2k views Asked by At

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

3

There are 3 answers

0
DEfusion On BEST ANSWER

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.

0
AudioBubble On

Maybe you use the Ruby version 1.8.7

You don't need the smtp_tls before.

You just need add the enable_startls_auto option:

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

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