Running into Smtp Error When Trying to Send Email in Ror App

Running into SMTP error when trying to send email in RoR app

The reason that you are seeing this error is that Google has blocked your IP. You will need to enable authorization for this IP.

Go to http://www.google.com/accounts/DisplayUnlockCaptcha and click continue.

Then again try to send email from the application, it should work. You will need to send email from your app within 10 min of visiting the above link. By visiting above link, Google will grant access to register new apps for 10 min.

rails3 can't send smtp email in production mode

I solved my problem with a change to a new passwort (api-key) from mandrill. Still don't know what the problem was, because with the old one it worked in development mode...

The working setting:

YourApp::Application.configure do
config.action_mailer.smtp_settings = {
:address => "smtp.mandrillapp.com",
:port => 587,
:enable_starttls_auto => true,
:user_name => "MANDRILL_USERNAME",
:password => "MANDRILL_PASSWORD", # SMTP password is any valid API key
:authentication => 'login'
}

Rails SMTP error

Do you have the ActionMailer smtp settings defined anywhere? You could put them in config/initializers/setup_mail.rb.

setup_mail.rb

ActionMailer::Base.smtp_settings = {  
:address => "smtp.mandrillapp.com",
:port => 587,
:user_name => "MANDRILL_USERNAME",
:password => "MANDRILL_SMTP_PASS"

}

And in your config/environments/production.rb:

  config.action_mailer.delivery_method = :smtp
config.action_mailer.perform_deliveries = true
config.action_mailer.raise_delivery_errors = false
config.action_mailer.default :charset => "utf-8"

Net::SMTPAuthenticationError when sending email from Rails app (on staging environment)

I had the same problem: emails were sent from development, but not from production (where I was getting Net::SMTPAuthenticationError).
This drove me to conclusion that the problem was not with my app's configuration, but with Google.

Reason: Google was blocking access from unknown location (app in production)

Solution: Go to http://www.google.com/accounts/DisplayUnlockCaptcha and click continue (this will grant access for 10 minutes for registering new apps).
After this my app in production started sending emails ;)

Wrong Default From value in Rails Mailer leads to SMTP error on Heroku with SendGrid

Verify your action_mailer configured properly, (config/production.rb):

  # Sendgrid
config.action_mailer.smtp_settings = {
address: "smtp.sendgrid.net",
port: 25,
domain: "example.com",
authentication: "plain",
user_name: ENV["SENDGRID_USERNAME"],
password: ENV["SENDGRID_PASSWORD"]
}

Don't forget to change the domain parameter!
Add sendgrid to your heroku app, as following (in your terminal):

heroku addons:add sendgrid:starter

Commit changes and deploy your application to heroku. You should be able to send emails from domain you previously defined.

SMTP email errors in Rails

The error code and the description of the error states that this is an error on the mail server.

I suggest you check the mail servers to pinpoint the error (probably out of disk space or something similar).

When it comes to ActionMailer it is supposed to raise an exception if the configuration parameter raise_delivery_errors is set (default in Production but not in Development I believe), so you can check that one and try to resend if it triggers.

Mail not sent but no error or exception in rails

in config/environments/development.rb
I have add this:

#enable using ActionMailer
config.action_mailer.default_url_options = { :host => "localhost:3000" }

# enable send mail with specified account
ActionMailer::Base.delivery_method = :smtp
ActionMailer::Base.smtp_settings = {
:enable_starttls_auto => true,
:address => "smtp.gmail.com",
:port => 587,
:authentication => :plain,
:user_name => "yyyyyy",
:password => "xxxxxxxxxx"

and for me work. I hope help you.



Related Topics



Leave a reply



Submit