简体   繁体   English

将SMTP电子邮件从其他电子邮件发送到smtp服务器导轨

[英]Send SMTP email from different email to smtp server rails

I have set up an actionmailer for a basic contact form that send the email via my gmail address. 我已经为基本的联系表单设置了一个actionmailer,该表单通过我的gmail地址发送电子邮件。

At the moment when I send an email, the from address, is my gmail address, whereas I would like it to be the email address entered into the contact form. 在我发送电子邮件的那一刻,发件人地址是我的Gmail地址,而我希望它是在联系表单中输入的电子邮件地址。

mail(to: "testemail@gmail.com", from: @email, subject: "Test Subject") 邮件(收件人:“ testemail@gmail.com”,发件人:@email,主题:“测试主题”)

I couldn't find any answers for this, so how do I go about achieving this. 我找不到任何答案,所以我该如何实现这一目标。

Thanks! 谢谢!

You cannot do that anymore. 您不能再这样做了。 Unless the email address exists and is authorized to send email from gmail servers (credentials required) you will not be able to use random FROM address. 除非该电子邮件地址存在并且被授权从gmail服务器发送电子邮件(需要凭据),否则您将无法使用随机FROM地址。

Even if you are successful in sending an email like that from your own mail relay server, the email will almost always get marked as spam. 即使您成功地从自己的邮件中继服务器发送了这样的电子邮件,该电子邮件也几乎总是被标记为垃圾邮件。 There are several checks done on an email, such as: 电子邮件上有几项检查,例如:

  • DKIM Signing DKIM签名
  • SPF records SPF记录
  • Reverse DNS check 反向DNS检查

Hence, it is not advisable to use a FROM address entered on a web form. 因此,不建议使用在Web表单上输入的FROM地址。 It will spoil the reputation of your IP address. 它将破坏您IP地址的声誉。 That may result in your genuine emails also getting trapped by spam filters. 这可能会导致您的真实电子邮件也被垃圾邮件过滤器困住。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM