ActionMailer Question

Is it possible to send email using the SMTP server of my subscriber’s
website host? Customers who register at my site should be able send
email by
using my web app. I would like to use their SMTP server to send any
emails
that my customers want to send to their clients. I don’t know what the
relay
problem is, that’s why I want to confirm. TIA.

Try setting the ActionMailer server address to “localhost”. Your app is
on the same server as the SMTP server, so if you address the SMTP server
by domain name (mail.whatever.com) the server thinks it’s a relay and
doesn’t allow it.

ActionMailer::Base.server_settings = {
:address => “localhost”,
:port => 25,
:domain => “whatever.com”,
:user_name => “”,
:password => “”,
:authentication => :login
}

c.

Bala P. wrote:

Is it possible to send email using the SMTP server of my subscriber’s
website host? Customers who register at my site should be able send
email by
using my web app. I would like to use their SMTP server to send any
emails
that my customers want to send to their clients. I don’t know what the
relay
problem is, that’s why I want to confirm. TIA.

As long as (1) your app can get to that SMTP server and (2) the SMTP
sever allows your app to use it as a relay, you should be fine. I do
development against external SMTP servers all the time.

It’s very unlikely that your customer’s SMTP server is an open relay. If
you can use it as an SMTP host at all, your app probably needs an SMTP
username and password, which you’ll have to put in the appropriate
config/environments config file.

It’s also possible that your ISP blocks your apps from accessing an
outside SMTP server. This is common with a lot of consumer-grade ISPs
(i.e. Earthlink only allows customers to use the Earthlink SMTP
servers), but it’s unlikely if your app is running on a corporate
network or at a hosting facility.

Bala P. wrote:

Is it possible to send email using the SMTP server of my subscriber’s
website host? Customers who register at my site should be able send
email by
using my web app. I would like to use their SMTP server to send any
emails
that my customers want to send to their clients. I don’t know what the
relay
problem is, that’s why I want to confirm. TIA.

Thank you for the clarification. That was my original assumption. Now
I can test it to make sure that I don’t run into any other problems.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs