【发布时间】:2012-01-13 00:56:21
【问题描述】:
我遵循了一个在 Rails 中发送电子邮件的教程,我的 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'
}
还有这个 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
)
当它发送电子邮件时,电子邮件来自 mygmailusername@gmail.com 而不是 noreply@myapp.heroku.com。我该如何解决这个问题?
【问题讨论】:
标签: ruby-on-rails-3 actionmailer