为rails设置sendgrid..返回授权错误

发布于 2024-09-03 21:43:49 字数 914 浏览 8 评论 0原文

电子邮件现在从我的本地发送,但不从我的邮箱发送。我返回这个错误。有人知道这可能是什么吗?

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

猫弦 2024-09-10 21:43:49

发生这种情况通常是因为您的帐户尚未配置。

This usually happens because your account hasn't been provisioned.

逆流 2024-09-10 21:43:49

顺便说一句,我发现将 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

绻影浮沉 2024-09-10 21:43:49

注册 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

萧瑟寒风 2024-09-10 21:43:49

我的测试服务器也遇到了类似的问题,由于不活动,该帐户被禁用。我使用 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文