I followed a tutorial for sending email in Rails, and I have this in my production.rb
ActionMailer::Base.smtp_settings = {
:tls => true,
:address => 'smtp.gmail.com',
:port => 587,
:domain => 'http://myapp.heroku.com',
:authentication => :plain,
:user_name => 'mygmailusername@gmail.com',
:password => 'mypassword'
}
And this Actionmailer
mail(
:to => user.email,
:from => "noreply@myapp.heroku.com",
:subject => "Welcome to My App",
:body => "Please activate your account by going to this address: \n" +
"http://myapp.heroku.com/" +
user.username + "/activate/" + user.activation_key
)
When it sends an e-mail, the e-mail comes from mygmailusername@gmail.com instead of from noreply@myapp.heroku.com. How can I fix this?
You can’t, GMail does let you send mail as somebody else (for the obvious reason).