Search code examples
ruby-on-railspluginssmtpar-mailer

Rails ar_mailer fails to send emails


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


Solution

  • 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.