![](/img/trans.png)
[英]535 Authentication Failed - Twilio SendGrid SMTP Relay NodeJS
[英]Heroku. Sendgrid add-on. There is an Net::SMTPAuthenticationError (535 Authentication failed: account disabled) error when sending emails
我在 Heroku 上为我的免费应用程序 (Ruby on Rails) 添加了 Sendgrid 附加组件。
production.rb
文件中的配置:
config.action_mailer.raise_delivery_errors = true
config.action_mailer.delivery_method = :smtp
host = 'mysterious-badlands-89513.herokuapp.com'
config.action_mailer.default_url_options = { host: host }
ActionMailer::Base.smtp_settings = {
:address => 'smtp.sendgrid.net',
:port => '587',
:authentication => :plain,
:user_name => ENV['SENDGRID_USERNAME'],
:password => ENV['SENDGRID_PASSWORD'],
:domain => 'heroku.com',
:enable_starttls_auto => true
}
但是当我试图触发 email 发送时,出现错误Net::SMTPAuthenticationError (535 Authentication failed: account disabled)
。
应用日志:
2020-04-25T01:09:46.119736+00:00 app[web.1]:
2020-04-25T01:09:46.120039+00:00 app[web.1]: I, [2020-04-25T01:09:46.119979 #10] INFO -- : [5ffafd44-806d-40e5-b0cf-fd87bdaaef67] Completed 500 Internal Server Error in 820ms (ActiveRecord: 5.9ms | Allocations: 6970)
2020-04-25T01:09:46.120762+00:00 app[web.1]: F, [2020-04-25T01:09:46.120706 #10] FATAL -- : [5ffafd44-806d-40e5-b0cf-fd87bdaaef67]
2020-04-25T01:09:46.120762+00:00 app[web.1]: [5ffafd44-806d-40e5-b0cf-fd87bdaaef67] Net::SMTPAuthenticationError (535 Authentication failed: account disabled
2020-04-25T01:09:46.120763+00:00 app[web.1]: ):
2020-04-25T01:09:46.120763+00:00 app[web.1]: [5ffafd44-806d-40e5-b0cf-fd87bdaaef67]
2020-04-25T01:09:46.120763+00:00 app[web.1]: [5ffafd44-806d-40e5-b0cf-fd87bdaaef67] app/models/user.rb:50:in `send_activation_email'
2020-04-25T01:09:46.120763+00:00 app[web.1]: [5ffafd44-806d-40e5-b0cf-fd87bdaaef67] app/controllers/users_controller.rb:23:in `create'
2020-04-25T01:09:46.123840+00:00 heroku[router]: at=info method=POST path="/users" host=mysterious-badlands-89513.herokuapp.com request_id=5ffafd44-806d-40e5-b0cf-fd87bdaaef67 fwd="24.80.110.141" dyno=web.1 connect=1ms service=827ms status=500 bytes=1891 protocol=https
2020-04-25T01:09:46.369543+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=mysterious-badlands-89513.herokuapp.com request_id=744e6f86-cca5-45b0-b68e-7fbc5a9ca914 fwd="24.80.110.141" dyno=web.1 connect=1ms service=1ms status=304 bytes=112 protocol=https
另一个奇怪的事情。 当我尝试从 Heroku 上的“资源”选项卡打开 SendGrid 页面时,我只看到“访问被拒绝”页面。
任何想法出了什么问题?
您是否在您的 Heroku 帐户中定义ENV['SENDGRID_USERNAME']
和ENV['SENDGRID_PASSWORD']
? 有文档可以帮助解决这个问题。 您收到的错误消息表示您的帐户未正常启动和运行。 检查我第一次提到的凭据,否则尝试将 SendGrid 重新配置为 Heroku 中的附加组件。
我的帐户由于某种原因刚刚被禁止。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.