如何在AWS EC2上将Gmail SMTP与端口587一起使用? [英] How do I use Gmail SMTP with port 587 on AWS EC2?

查看:374
本文介绍了如何在AWS EC2上将Gmail SMTP与端口587一起使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已将Gmail SMTP服务与本地服务器上的端口587一起使用,并且工作正常.

I have used Gmail SMTP service with port 587 on the local server and it's working fine.

但是它不适用于AWS EC2实例.因此,我在EC2实例安全入站规则上添加了SMTP规则,如下图所示,但SMTP端口不可编辑.

But it's not working on AWS EC2 instance. So I added SMTP rules on EC2 instance security inbound rules see below image but SMTP port can not be editable.

现在的问题是,如果您的域未配置安全连接. Gmail在不安全的连接中不提供端口25.

Now the issue is if your domain does not configure secured connections. Gmail does not offer port 25 in an unsecured connection.

因此,有任何方法可以在具有25端口的不安全连接上使用SMTP或其他任何方式.

So, there is any way to use SMTP on unsecured connection with 25 port or any other way.

推荐答案

到目前为止,我已经解决了开发服务器的问题.请,这不是通往生产现场的正确方法.

I have fixed issue as of now for a development server. Please, not it's not the correct way to a production site.

要使用Gmail SMTP服务从AWS EC2发送电子邮件,请按照以下步骤操作.

For sending an email from AWS EC2 using Gmail SMTP service please follow below steps.

  1. 编辑您的EC2实例的安全组.
  2. 编辑安全组的入站规则.
  3. 在入站规则中添加587端口.参见下图.

您需要为传入的邮件和发送的出站设置实例入站规则.

you need to set your instance inbound rules for coming mail and outbound for send.

之后,您可以使用来自AWS EC2的587 SMTP端口发送电子邮件.

After that, you can send email using 587 SMTP port from AWS EC2.

请阅读这篇文章. https://support.google.com/accounts/answer/6010255?hl=zh_CN

https://myaccount.google.com/lesssecureapps

这篇关于如何在AWS EC2上将Gmail SMTP与端口587一起使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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