How should I set up my SMTP settings in my initializer file using Godaddy mail?
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.
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)
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With