I'm trying to send emails in a Rails app. It works if I use Gmail, but it's not working if I use Mandrill. I'm getting this timeout error with Mandrill. Not sure what I'm doing wrong. With both Gmail and Mandrill I am setting the username and password/api_key using environment variables. The only difference between the two setups is what you see below. Any ideas?
Timeout::Error in RegistrationsController#create
execution expired
Rails.root: /Users/michaeljohnmitchell/Sites/pre
Application Trace | Framework Trace | Full Trace
app/models/user.rb:38:in `send_welcome_email'
Mandrill Doesn't work
config.action_mailer.smtp_settings = {
:address => "smtp.mandrillapp.com",
:port => 25,
:user_name => ENV["MANDRILL_USERNAME"],
:password => ENV["MANDRILL_API_KEY"]
}
Gmail Works
config.action_mailer.smtp_settings = {
address: "smtp.gmail.com",
port: 587,
authentication: "plain",
enable_starttls_auto: true,
user_name: ENV["GMAIL_USERNAME"],
password: ENV["GMAIL_PASSWORD"]
}
use port 587 for mandrill, happend the same to me :)
this is because port 25 is sending plain text and port 587 sends SSL encoded emails (which I think is the whole mandrill idea).
I have no idea why they set it to port 25 in their examples.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With