Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails Mailer Net::SMTPServerBusy

With my rails site, when I try to send mail through GMail, it works perfectly. But when I try to send it through MandrillApp, it gives the following error (RController.create is where the deliver command is called):

Net::SMTPServerBusy in RController#create 
454 4.7.1 <[email protected]>: Relay access denied

Here's my config/environments/development.rb file:

 # ActionMailer Config
 config.action_mailer.default_url_options = { :host => 'localhost:3000' }
 config.action_mailer.delivery_method = :smtp
config.action_mailer.default :charset => "utf-8"

config.action_mailer.perform_deliveries = true
config.action_mailer.raise_delivery_errors = true

config.action_mailer.delivery_method = :smtp
# config.action_mailer.smtp_settings = {
#   :address              => "smtp.gmail.com",
#   :port                 => 587,
#   :domain               => 'gmail.com',
#   :user_name            => '[email protected]',
#   :password             => 'password',
#   :authentication       => 'plain',
#   :enable_starttls_auto => true  }

config.action_mailer.smtp_settings = {
:address   => "smtp.mandrillapp.com",
:port      => 587,
:user_name => ENV["EMAIL"],
:password  => ENV["PASSWORD"]
}

As it is above, the code doesn't work - I don't get an email and no errors pop up. If I switch to sending it from GMail, I get an email almost instantly. I've never worked with Mandrill before, so any help would be appreciated.

like image 866
camdroid Avatar asked Dec 20 '12 01:12

camdroid


3 Answers

I ended up talking to a service rep from Mandrill, and it turns out that I was using the actual strings instead of the environment variables, so I just had to remove "ENV" from the config file.

I ended up going back and making environment variables for security's sake, but I just thought I'd throw that out there in case anyone else has the same problem and finds this question.

like image 200
camdroid Avatar answered Oct 22 '22 06:10

camdroid


Have you tried looking at the following set up Mandrill SMTP Integration. Hope it helps

like image 2
Deej Avatar answered Oct 22 '22 04:10

Deej


You can also check if the ENV variables are set in the first place.

like image 1
Nesha Zoric Avatar answered Oct 22 '22 06:10

Nesha Zoric