为rails设置sendgrid..返回授权错误
电子邮件现在从我的本地发送,但不从我的邮箱发送。我返回这个错误。有人知道这可能是什么吗?
Net::SMTPAuthenticationError (535 5.7.8 错误:身份验证失败:身份验证失败 ):
我的环境/生产.rb
ActionMailer::Base.delivery_method = :smtp
ActionMailer::Base.smtp_settings = {
:address => "smtp.sendgrid.net",
:port => '25',
:domain => "mydomain.com",
:authentication => :plain,
:user_name => "[email protected]",
:password => "password1234"
}
/etc/ssmtp/ssmtp.conf :
root=postmaster
mailhub=smtp.sendgrid.net
[email protected]
AuthPass=password1234
AuthMethod=LOGIN
rewriteDomain=mydomain.com
FromLineOverride=YES
UseSTARTTLS=NO
The emails now send from my local, but do not send from my box. I am returned this error. Anyone know what this might be?
Net::SMTPAuthenticationError (535 5.7.8 Error: authentication failed: authentication failure
):
My environments/production.rb
ActionMailer::Base.delivery_method = :smtp
ActionMailer::Base.smtp_settings = {
:address => "smtp.sendgrid.net",
:port => '25',
:domain => "mydomain.com",
:authentication => :plain,
:user_name => "[email protected]",
:password => "password1234"
}
/etc/ssmtp/ssmtp.conf :
root=postmaster
mailhub=smtp.sendgrid.net
[email protected]
AuthPass=password1234
AuthMethod=LOGIN
rewriteDomain=mydomain.com
FromLineOverride=YES
UseSTARTTLS=NO
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
发生这种情况通常是因为您的帐户尚未配置。
This usually happens because your account hasn't been provisioned.
顺便说一句,我发现将 PostFix 与 SendGrid 一起使用更有利,因此用户在使用 Rails 应用程序时的延迟会更少。当我使用 SMTP(如上面所示)时,在加载发送邮件的操作时出现长时间延迟。
有关详细信息,请参阅此 SendGrid wiki 页面:
http://wiki.sendgrid.com/doku.php?id=postfix
By the way, I find that it's more favourable to use PostFix with SendGrid so there is less delay for the user when they are using your rails app. When I was using SMTP (like you have above), I was getting long delays when loading an action that sent mail.
See this SendGrid wiki page for more info:
http://wiki.sendgrid.com/doku.php?id=postfix
注册 SendGrid 时,将由管理员审核,然后您才能从新帐户发送邮件。
看:
https://support.sendgrid.com/hc/en-us/articles/200181628
When registering to SendGrid it will be moderated by admin before you can send mail from new account.
See:
https://support.sendgrid.com/hc/en-us/articles/200181628
我的测试服务器也遇到了类似的问题,由于不活动,该帐户被禁用。我使用 SendGrid 创建了支持票证,然后它被重新激活。
I had a similar issue with my test server and due to inactivity, the account was disabled. I created a Support ticket with SendGrid and it was reactivated.