我正在开发一个Rails应用程序,当我在本地运行它时,它可以通过smtp通过Gmail帐户发送电子邮件。
当我把它移到我的服务器时,例如当我尝试创build一个新用户时,出现以下错误。
Net::SMTPAuthenticationError in UsersController#create 535-5.7.1 Username and Password not accepted.
为了确保您的SMTP信息应该如下所示:
# Correct configuration to get this working is: config.action_mailer.smtp_settings = { :enable_starttls_auto => true, :address => 'smtp.gmail.com', :port => 587, :domain => 'whatever.yourrubyapp.com', :authentication => :plain, :user_name => '[email protected]', :password => 'password' }