Rails和Gmail SMTP,如何使用自定义地址 [英] Rails and Gmail SMTP, how to use a custom from address

查看:168
本文介绍了Rails和Gmail SMTP,如何使用自定义地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有我的Rails(2.1)应用程序设置通过Gmail发送电子邮件,但是无论何时我发送电子邮件,无论我在ActionMailer中设置了哪个地址,电子邮件总是像从我的Gmail电子邮件地址发送。这是否是他们在Gmail中实施的一项安全限制,以阻止垃圾邮件发送者使用SMTP?

注意:我在ActionMailer中尝试了以下两种方法(以防万一):

  @from = me@mydomain.com 
from'me@mydomain.com'


解决方案

我相信这只是Gmail通过邮件发送它的SMTP,正如它提到的,他们在关于使用SMTP发送邮件的教程上这样做。


I've got my Rails (2.1) app setup to send email via Gmail, however whenever I send an email no matter what I set the from address to in my ActionMailer the emails always come as if sent from my Gmail email address. Is this a security restriction they've put in place at Gmail to stop spammers using their SMTP?

Note: I've tried both of the following methods within my ActionMailer (just in case):

@from = me@mydomain.com
from 'me@mydomain.com'

解决方案

I believe it's just something Gmail does when mail is sent through its SMTP, as it was mentioned that they do this on a tutorial about using their SMTP to send mail.

这篇关于Rails和Gmail SMTP,如何使用自定义地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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