I have setup ActionMailer to send mails via Gmail.
Here are the settings:
config.action_mailer.smtp_settings = {
:address => “smtp.gmail.com”,
:port => “587”,
:domain => “example.com”,
:authentication => :plain,
:user_name => “[email protected]”,
:password => “secret”
}
The “admin” username has an email account setup with a name of “Mailer
Account”
How do I set the From: header so that the user’s inbox shows the name on
the account that the mail is sent from instead of the username “admin”
that shows up currently.
Gmail does not let you alter the “from” email address when relaying.
You can specify the “from” name in your mailer, but it will use the
“from” address for the credentials that you supply to log into your
account. I wanted emails to come from “My Company [email protected]”, but our webmaster account is a nickname
for my account, so it does not have its own login credentials. Since
I had to use my account information to log in, when I send an email,
it will say “My Company [email protected]” in the “from”
field.
If you’re not using Gmail, specifying “from” in the mailer works fine.