Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SMTP settings using Godaddy mail with Rails 3

How should I set up my SMTP settings in my initializer file using Godaddy mail?

like image 999
user730569 Avatar asked Apr 29 '11 06:04

user730569


People also ask

How do I use SMTP in Ruby on Rails?

Go to the config folder of your emails project and open environment. rb file and add the following line at the bottom of this file. It tells ActionMailer that you want to use the SMTP server. You can also set it to be :sendmail if you are using a Unix-based operating system such as Mac OS X or Linux.

What is the incoming mail server for GoDaddy?

Incoming Mail Server: Your incoming IMAP server. Outgoing Mail Server: Your outgoing SMTP server. Incoming Port: 143 (without SSL) or 993 (with SSL) Outgoing Port: 25, 80, or 3535 (without SSL); 465 or 587 (with SSL)


1 Answers

Shamelessly taken from the article here: http://pilotoutlook.wordpress.com/2008/10/13/setup-email-in-ruby-on-rails-using-godaddysmtp/

Open ROOT/config/environment.rb file For sendmail, add following lines -

ActionMailer::Base.delivery_method = :sendmail
ActionMailer::Base.smtp_settings = {
:domain  => ‘www.example.com’
}

For Godaddy, add following lines -

ActionMailer::Base.delivery_method = :smtp
ActionMailer::Base.smtp_settings = {
:address => ‘smtpout.secureserver.net’,
:domain  => ‘www.example.com’,
:port      => 80,
:user_name => ‘[email protected]’,
:password => ‘yourpassword’,
:authentication => :plain
}

Save and restart your webserver. You are all set.

Remember that you can only send 300 emails per day from Godaddy, so if you need to send more emails, you will have to use sendmail or some other solution.

Note the port is NOT set to 25 - this is on purpose. GoDaddy's email servers are configured to use several ports, just in case 25 is blocked.

like image 180
Dan Esparza Avatar answered Oct 02 '22 13:10

Dan Esparza