Rails ActionMailer Setup with Yahoo SMTP setting

Code kept throwing”Errno::ECONNRESET (Connection reset by peer):’ error whenever I tried to connect to yahoo’s smtp server and send a message. It took me a while to figure what the problem was: Yahoo suggest me to use port 465; but the correct port number to use is 587!

So to save you couple of hours filled with frustration and hair pullings, here’s the action_mailer setup that works:

ActionMailer::Base.default_charset = "utf-8"
ActionMailer::Base.delivery_method = :smtp
ActionMailer::Base.smtp_settings = {
:address => "smtp.bizmail.yahoo.com",
:port => 587,
:domain => "www.your-domain.com",
:user_name => "username@your-domain.com",
:password => "some-password" ,
:enable_starttls_auto => true,
:authentication => :plain
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s