我尝试使用ruby on rails向邮件发送消息,但它没有送达,尽管代码中有0错误
mail(:to => user.email, :subject => "Welcome to My site")圆锥体
ActionMailer::Base.smtp_settings = {
:address => "smtp.gmail.com",
:port => 587,
:domain => "gmail.com",
:user_name => "username",
:password => "password",
:authentication => "plain",
:enable_starttls_auto => true
}
RegistedMailer.sendingmail(@profolio).deliver请注意localhost上的应用程序buit
发布于 2013-04-03 07:45:28
发货方式的设置是什么?它应该是:
config.action_mailer.delivery_method = :smtp发布于 2013-04-03 07:55:00
在开发模式下,Rails不会发送电子邮件。确保您在per the Rails Guides Action Mailer Configuration for GMail页面上设置了以下内容:
config.action_mailer.delivery_method = :smtp如果已经设置好了,你能发布你的日志吗?
您可能还想研究一下something like MailCatcher,它使在开发模式下测试电子邮件变得更容易。
https://stackoverflow.com/questions/15774585
复制相似问题