Reputation: 4004
How should I set up my SMTP settings in my initializer file using Godaddy mail?
Upvotes: 5
Views: 4782
Reputation: 28367
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.
Upvotes: 11
Reputation: 15097
# config/environments/production.rb
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
:address => 'smtpout.secureserver.net',
:domain => 'www.example.com',
:port => 80,
:user_name => '[email protected]',
:password => 'yourpassword',
:authentication => :plain
}
Upvotes: 6