开发者

Setting up sendgrid for rails..returning Authorization error

开发者 https://www.devze.com 2023-01-02 02:53 出处:网络
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?

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@gmail.com",
  :password => "password1234"
 }

/etc/ssmtp/ssmtp.conf :

root=postmaster
mailhub=smtp.sendgrid.net
AuthUser=email@gmail.com
AuthPass=password1234
AuthMethod=LOGIN开发者_StackOverflow中文版
rewriteDomain=mydomain.com
FromLineOverride=YES
UseSTARTTLS=NO


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


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


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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消