通过公司的Gmail帐户使用ActionMailer [英] Using ActionMailer with a company Gmail account

查看:63
本文介绍了通过公司的Gmail帐户使用ActionMailer的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不确定这是否属于服务器故障,或者如果在其他地方更有意义,请随时将其移动。我已经看到了设置smtp设置以及在Gmail中使用ActionMailer的示例,并确认它们对我有用。

I'm not sure if this belongs in server fault or here feel free to move it if it makes more sense somewhere else. I've seen the examples for setting up the smtp settings and using ActionMailer with Gmail and confirmed that they work for me.

对于我来说,基本上像这样:

Basically it looks like this for me:

config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
  :address              => "smtp.gmail.com",
  :port                 => 587,
  :user_name            => '<username>',
  :password             => '<password>',
  :authentication       => 'plain',
  :enable_starttls_auto => true  }

我现在要做的是向非以下地址发送电子邮件普通的Gmail帐户,但实际上是Gmail。我的公司使用任何允许您使用gmail的google电子邮件服务,但其地址列为username@my.company.com而不是@ gmail.com。我知道,您不能简单地在主要gmail网站上登录我们的邮件,因此我认为我们的域是不同的。

What I need to do now is to send an email to an address that isn't a plain Gmail account and yet, at it's core, is Gmail. My company uses whatever google's email service that allows you to use gmail but for the addresses to be listed as username@my.company.com rather than @gmail.com. I know for a fact that you can't simply log into our mail at the main gmail site so I assume our domain is different. Or something.

此刻,当我只使用自己公司的用户名/通行证时,我收到一条错误消息,告诉我用户名/通行证错了。但是我想问题是我正在尝试从我的用户名的gmail变体发送邮件。

At the moment, when I simply use my own company user/pass I get an error message telling me that the user/pass was wrong. But I'm guessing the issue is that I'm trying to mail from the gmail variant of my username.

我已经确认我们的smtp服务器,直到Thunderbird关心的是普通的gmail smtp,我们的端口仍然是587,并且我们正在使用TLS。我需要在此处进行什么更改才能将电子邮件发送到这些地址之一?谢谢。

I have confirmed that our smtp server, as far as Thunderbird is concerned, is the normal gmail smtp, that our port is still 587, and that we are using TLS. What do I need to change here so that I can send an email to one of these addresses? Thanks.

推荐答案

我在google上有自己的域设置来接收邮件,直接登录的网址是

I have my own domain setup at google for mail, the url to log into that directly is

http://mail.google.com/ a / my.company.com

我的通过该帐户发送邮件的Rails应用

My rails app that sends mail through that account, has

:domain => "my.company.com"

以及您拥有的所有其他字段。

as well as all the other fields you have.

< user_name> 必须是整个电子邮件地址,而不仅仅是用户名。

"<user_name>" needs to be the whole email address, not just the user name.

这篇关于通过公司的Gmail帐户使用ActionMailer的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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