ActionMailer Rails:无法发送电子邮件
我的环境/development.rb中有以下代码
config.action_mailer.raise_delivery_errors = true;
config.action_mailer.delivery_method = :smtp;
config.action_mailer.smtp_settings = {
:address => "smtp.gmail.com",
:port => 587,
:user_name => "[email protected]",
:password => "secret",
:authentication => :plain,
:enable_starttls_auto => true,
:domain => "localhost",
}
通过调用邮件程序模型来生成一封电子邮件 我的控制器。但是,我无法发送或接收任何 Gmail 上的电子邮件。
我使用的是 ruby 1.8.7,rails 2.3.5。 没有例外,只是没有交换电子邮件 实际邮件服务器之间。
作为邮件程序的新手,对于任何菜鸟问题表示抱歉。
类似的查询: Actionmailer 无法在 Rails 2.3 中工作
谢谢
I have the following code in my environment/development.rb
config.action_mailer.raise_delivery_errors = true;
config.action_mailer.delivery_method = :smtp;
config.action_mailer.smtp_settings = {
:address => "smtp.gmail.com",
:port => 587,
:user_name => "[email protected]",
:password => "secret",
:authentication => :plain,
:enable_starttls_auto => true,
:domain => "localhost",
}
An email is being generated by the call to the mailer model from one
of my controllers. However, i am not able to send or receive any
emails on gmail.
I am on ruby 1.8.7, rails 2.3.5.
There are no exceptions, just that no emails are being exchanged
between the actual mail servers.
Being quite new to mailer, sorry for any rookie questions.
A similar query:
Actionmailer not working in rails 2.3
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在代码上方,您需要将这些行强制用于身份验证:
您还需要 tlsmail gem。
如果不起作用,您可以尝试从设置中删除域密钥。
Above your code you you need to put those lines mandatory for the authentication:
You need also the tlsmail gem.
If it doesn't work you can try removing the domain key from you settings.
您是否在发送邮件之前使用 STARTTLS 进行身份验证?
Are you doing authentication with STARTTLS before sending the mail?