rails email error - 530-5.5.1 Authentication Required.

后端 未结 2 1382
渐次进展
渐次进展 2020-12-21 09:41

trying to send email form Ruby on Rails but getting this:

SocketError in UsersController#create
getaddrinfo: nodename nor servname provided, or not known
         


        
2条回答
  •  北海茫月
    2020-12-21 10:14

    In case others face the same issue, I just wanted to add that I had the exact same problem trying to implement a mailing system with gmail in my Rails API, and adding :openssl_verify_mode => 'none' did not solve the problem for me.

    Instead, installing the figaro gem and then adding my environment variable in application.yml like so:

    gmail_username: "myemail@gmail.com"
    gmail_password: "mypassword"
    

    did the trick for me.

    (and dont forget to change you SMTP settings: )

    user_name:             ENV['gmail_username'],
    password:              ENV['gmail_password'],
    

提交回复
热议问题