Welcome Guest | Login

Configuring Action Mailer to Send Mail

I am pretty new to rails and hosting so sorry if this is novice question.
I am trying to get my application to send email using ActionMailer.

I created an email account called admin@mydomain.com with password "mypassword" using cpanel

I have put the following in my my config/environments/production.rb

# Disable delivery errors, bad email addresses will be ignored
config.action_mailer.delivery_method = :smtp
config.action_mailer.raise_delivery_errors = true
config.action_mailer.perform_deliveries = true
config.action_mailer.default_charset = "utf-8"

config.action_mailer.server_settings = {
  :address => "localhost"
  :port => 25,
  :domain => "mydomainname.com",
  :authentication => :login,
  :user_name => "admin",
  :password => "mypassword"
}

I have probably not set the :address or :domain correctly since I am not exactly sure how to set them up.


The web page comes back with the "sorry but something went wrong" message and my production log file contains the following message:

Net::SMTPAuthenticationError (535 Incorrect authentication data
):
   /usr/local/lib/ruby/1.8/net/smtp.rb:586:in `auth_login'
   /usr/local/lib/ruby/1.8/net/smtp.rb:571:in `__send__'
   /usr/local/lib/ruby/1.8/net/smtp.rb:571:in `authenticate'
   /usr/local/lib/ruby/1.8/net/smtp.rb:411:in `do_start'
   /usr/local/lib/ruby/1.8/net/smtp.rb:378:in `start'
   /usr/local/lib/ruby/1.8/net/smtp.rb:316:in `start'
 

2007-09-01 11:58 PM

Try changing the following Action mailer settings. :address should be "mail.yourdomain.com",  :domain => "yourdomain.com" , :user_name => "email_account_login", :password => "email_account_password"

2007-09-02 12:39 AM

Regards,
Rahul
or you can just use sendmail if you'd like...its faster.  All you need in your environment.rb file is:

ActionMailer::Base.delivery_method = :sendmail  
ActionMailer::Base.perform_deliveries = true  
ActionMailer::Base.raise_delivery_errors = true  
ActionMailer::Base.default_charset = "utf-8"

2007-09-02 02:43 AM

Thanks Rahula and William.  I have tried the suggestion by William.  My production.log shows a message sent mail: with the body of the email following.  The SMTPAuthenticationError message that used to follow that is gone which is good.

However, the email never arrives at the destination.  Is there a way to check in some sendmail log that the email actually got sent?  Not sure how to debug from here.

2007-09-02 12:34 PM

Hello,

I am sorry you will not be able to view your email logs. You can post a ticket to the support team with details including the destination address. We can help you to see if there is any error in the logs. Thank you

2007-09-02 12:49 PM

HostingRails Support
Thanks.  I found the error I wasn't properly setting recipients in the action mailer model.  Thinks are working now.

2007-09-02 01:19 PM


Hello Guest! In order to post you must be an active client with us, please log in or sign up.



Previous URLs for this page here and here