行动邮件SMTP Google工具 [英] Action mailer SMTP google apps

查看:197
本文介绍了行动邮件SMTP Google工具的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试将actionmailer配置为通过smtp通过google应用发送。

I tried to configure actionmailer to send via google apps with 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尝试发送电子邮件:

However whenever gitlab tries to send an e-mail:

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。为什么Google应用程序不接受用户名/密码?

Server runs ruby 1.9.3p194. Why doesn't google apps accept the username/password?

推荐答案

现在可以了,我认为问题出在用户名上。它需要用户名中的域。即问题是

It works now, I think the problem was with the username. it needs the domain in the username. i.e. the problem was

user_name: 'username'

正确的方法(至少对于Google应用而言)是

Whereas the correct way (at least for google apps) is

user_name : 'username@mydomain.com'

这篇关于行动邮件SMTP Google工具的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆