I’ve got the following configured in environment.rb:
ActionMailer::Base.server_settings = {
:address => “mail.xyz.com”,
:port => 25,
:domain => “www.xyz.com”,
:user_name => “user”,
:password => “password”,
:authentication => :login
}
I can connection to the ISP’s SMTP server with my email client, and it
sends just fine. But from my RoR app, the SMTP server is basically
saying it’s not authenicating. It isn’t using TLS authenication.
Any ideas? The odd thing is that ActionMailer doesn’t throw an exception
- it thinks everything has gone smoothly.
jim dandy wrote:
I’ve got the following configured in environment.rb:
ActionMailer::Base.server_settings = {
:address => “mail.xyz.com”,
:port => 25,
:domain => “www.xyz.com”,
:user_name => “user”,
:password => “password”,
:authentication => :login
}
I can connection to the ISP’s SMTP server with my email client, and it
sends just fine. But from my RoR app, the SMTP server is basically
saying it’s not authenicating. It isn’t using TLS authenication.
Any ideas? The odd thing is that ActionMailer doesn’t throw an exception
- it thinks everything has gone smoothly.
Try changing :authentication to
:authentication => :plain
This made one of my apps work 100% of the time instead of 30%, even
though the SMPT server claims it accepts either.
–Al Evans
Al Evans wrote:
jim dandy wrote:
I’ve got the following configured in environment.rb:
ActionMailer::Base.server_settings = {
:address => “mail.xyz.com”,
:port => 25,
:domain => “www.xyz.com”,
:user_name => “user”,
:password => “password”,
:authentication => :login
}
I can connection to the ISP’s SMTP server with my email client, and it
sends just fine. But from my RoR app, the SMTP server is basically
saying it’s not authenicating. It isn’t using TLS authenication.
Any ideas? The odd thing is that ActionMailer doesn’t throw an exception
- it thinks everything has gone smoothly.
Try changing :authentication to
:authentication => :plain
This made one of my apps work 100% of the time instead of 30%, even
though the SMPT server claims it accepts either.
–Al Evans
Thanks for the tip - tried that and it still didn’t work. I gave up
trying to authenticate with my ISP’s SMTP server and ended up using
SendMail instead.
If anyone is trying to send email from their RoR applications, I would
suggest using sendmail - way faster and if you are running RHEL 4 or
some other distribution with it preinstalled, very easy to configure and
use. On our RHEL4 server I didn’t have to change a single configuration
item.
In environment.rb to use sendmail, you just need these 2 lines:
ActionMailer::Base.delivery_method = :sendmail
ActionMailer::Base.raise_delivery_errors = true
You don’t need the second one, but will save yourself a lot of headache
if you put that in.