ruby-on-rails – 动作邮件程序SMTP谷歌应用程序
发布时间:2020-12-17 04:23:03 所属栏目:百科 来源:网络整理
导读:我尝试配置actionmailer以通过谷歌应用程序与smtp发送. config.action_mailer.delivery_method = :smtpconfig.action_mailer.smtp_settings = {:address = "smtp.gmail.com",:port = 587,:domain = "mydomain.com",:user_name = "username",:password = "pas
我尝试配置actionmailer以通过谷歌应用程序与smtp发送.
config.action_mailer.delivery_method = :smtp config.action_mailer.smtp_settings = { :address => "smtp.gmail.com",:port => 587,:domain => "mydomain.com",:user_name => "username",:password => "password",:authentication => 'plain',:enable_starttls_auto => true } config.action_mailer.perform_deliveries = true config.action_mailer.raise_delivery_errors = true 但是每当gitlab尝试发送电子邮件时: Sent mail to user@my.domain.com (10ms) Completed 500 Internal Server Error in 29ms 535-5.7.1 Username and Password not accepted 服务器运行ruby 1.9.3p194.为什么谷歌应用程序不接受用户名/密码? 解决方法
它现在有效,我认为问题出在用户名上.它需要用户名中的域名.即问题是
user_name: 'username' 而正确的方式(至少谷歌应用程序)是 user_name : 'username@mydomain.com' (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |