设置一个Gmail帐户以在Rails 3中使用ActionMailer [英] Setting up a Gmail Account to work with ActionMailer in Rails 3
问题描述
我有一个联系页面表单,该表单用于将电子邮件发送到Gmail帐户。唯一的问题是它不会发送。我相信我已将错误缩小到初始化程序目录中的设置。
I have a contact page form that is setup to send an email to a Gmail account. Only problem is it won't send. I believe I have narrowed the error down to my settings inside of the initializers directory.
这些是我当前的尝试设置标准gmail帐户发送邮件的设置:
These are my current settings for trying to setup a standard gmail account to send mail:
可以吗是我的域名设置错误还是应该输入:user_name
myemail@gmail.com
?这是我第一次使用ActionMailer,所以我真的不知道自己在做什么。有人可以帮帮我吗?谢谢!
Could it be that my domain setting is wrong or should I be typing in myemail@gmail.com
for :user_name
? This is the first time I have used ActionMailer so I don't really know what I am doing. Can somebody please help me out!? Thanks!
推荐答案
如果您使用的是开发环境,请使用
更改development.rb以提高交付错误。 config.action_mailer.raise_delivery_errors = true
If you are using the development environment, change the development.rb to raise delivery errors, with config.action_mailer.raise_delivery_errors = true
另外,问题可能是:user_name应该是整个电子邮件地址(myemail@gmail.com),这就是Gmail验证用户身份的方式
Also, the problem might be that :user_name should be the entire email address (myemail@gmail.com), that's how Gmail authenticates users.
这篇关于设置一个Gmail帐户以在Rails 3中使用ActionMailer的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!