热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

从AWSEC2实例发送电子邮件(SES是强制性的?)-SendemailsfromAWSEC2instance(SESmandatory?)

IwritethispostjusttoseeifIcangetsomeclarificationsregardingemailsendingconceptsina

I write this post just to see if I can get some clarifications regarding email sending concepts in an AWS EC2 instance.

我写这篇文章只是为了看看我是否可以对AWS EC2实例中的电子邮件发送概念做出一些澄清。

This is related with this other post Rails does not send emails on AWS

这与其他帖子有关Rails不会在AWS上发送电子邮件

I´m developing a Rails application that sends emails to customers (such as confirmation or information emails).

我正在开发一个向客户发送电子邮件的Rails应用程序(例如确认或信息电子邮件)。

I dont know exactly which email service is using Rails. I didn´t install any particular gem. But the emails are been sent perfectly in development environment (Ubuntu).

我不确切知道哪个电子邮件服务正在使用Rails。我没有安装任何特定的宝石。但是电子邮件已经在开发环境(Ubuntu)中完美发送。

When I deploy to my production environment (AWS EC2 instance). This functionality is not working. You can see the error details in the post I provided above. The error is related with some smtp connection refused.

当我部署到我的生产环境(AWS EC2实例)时。此功能无效。您可以在我上面提供的帖子中看到错误详细信息。该错误与某些smtp连接被拒绝有关。

So, I have read some other posts but Im confused. Is it mandatory to use the AWS SES service in order to send emails from EC2 instance? Or it is just a problem related to security credentials (maybe I just need to open the smtp 25 port). Do I need to install any email client or server?

所以,我已经阅读了其他一些帖子,但我很困惑。是否必须使用AWS SES服务才能从EC2实例发送电子邮件?或者它只是与安全凭证相关的问题(也许我只需要打开smtp 25端口)。我是否需要安装任何电子邮件客户端或服务器?

2 个解决方案

#1


18  

Sending emails from EC2 instances is limited by Amazon and strictly throttled at network level. This is to prevent spamming and other abuses.

从EC2实例发送电子邮件受亚马逊限制,并严格限制在网络级别。这是为了防止垃圾邮件和其他滥用行为。

If you have a large amount of emails to send to your customers, the recommended way is to use Amazon Simple Email Service. With Amazon SES, you can send transactional email, marketing messages, or any other type of high-quality content and you only pay for what you use.

如果您有大量电子邮件要发送给您的客户,建议的方法是使用Amazon Simple Email Service。使用Amazon SES,您可以发送交易电子邮件,营销信息或任何其他类型的高质量内容,您只需为您使用的内容付费。

If you really need to send emails from an EC2 instance, you must use an Elastic IP Adress and ask Amazon's support to remove limitations on SMTP traffic from that EIP. The form to contact us is available at https://portal.aws.amazon.com/gp/aws/html-forms-controller/contactus/ec2-email-limit-rdns-request (authentication is required)

如果您确实需要从EC2实例发送电子邮件,则必须使用弹性IP地址并要求Amazon支持从该EIP中删除对SMTP流量的限制。有关联系我们的表格,请访问https://portal.aws.amazon.com/gp/aws/html-forms-controller/contactus/ec2-email-limit-rdns-request(需要验证)

Seb

勒布

#2


1  

As sebasto wrote, sending emails is limited.

正如塞巴斯托写道,发送电子邮件是有限的。

https://aws.amazon.com/ec2/faqs/ => Q: Are there any limitations in sending email from EC2 instances?

https://aws.amazon.com/ec2/faqs/ =>问:从EC2实例发送电子邮件有任何限制吗?

Of course it's working, you need to check if you have SMTP installed and it might depends when do you send your's emails

当然它正在运行,你需要检查你是否安装了SMTP,这可能取决于你何时发送你的电子邮件

Try this code:

试试这段代码:

[ec2-user@ip ~]$ irb
irb(main):001:0> require 'net/smtp'
=> true
irb(main):002:0> Net::SMTP.start('localhost') do |smtp|
irb(main):003:1* smtp.send_message 'test from ruby', 'your-email, 'your-email'
irb(main):004:1> end

For mine (@gmail) it's working

我的(@gmail)它正在运作


推荐阅读
  • PHP 5.2.5 安装与配置指南
    本文详细介绍了 PHP 5.2.5 的安装和配置步骤,帮助开发者解决常见的环境配置问题,特别是上传图片时遇到的错误。通过本教程,您可以顺利搭建并优化 PHP 运行环境。 ... [详细]
  • 本文详细介绍了如何使用 Yii2 的 GridView 组件在列表页面实现数据的直接编辑功能。通过具体的代码示例和步骤,帮助开发者快速掌握这一实用技巧。 ... [详细]
  • DNN Community 和 Professional 版本的主要差异
    本文详细解析了 DotNetNuke (DNN) 的两种主要版本:Community 和 Professional。通过对比两者的功能和附加组件,帮助用户选择最适合其需求的版本。 ... [详细]
  • 本文详细介绍了如何在 Linux 平台上安装和配置 PostgreSQL 数据库。通过访问官方资源并遵循特定的操作步骤,用户可以在不同发行版(如 Ubuntu 和 Red Hat)上顺利完成 PostgreSQL 的安装。 ... [详细]
  • CentOS7源码编译安装MySQL5.6
    2019独角兽企业重金招聘Python工程师标准一、先在cmake官网下个最新的cmake源码包cmake官网:https:www.cmake.org如此时最新 ... [详细]
  • 尽管使用TensorFlow和PyTorch等成熟框架可以显著降低实现递归神经网络(RNN)的门槛,但对于初学者来说,理解其底层原理至关重要。本文将引导您使用NumPy从头构建一个用于自然语言处理(NLP)的RNN模型。 ... [详细]
  • 获取计算机硬盘序列号的方法与实现
    本文介绍了如何通过编程方法获取计算机硬盘的唯一标识符(序列号),并提供了详细的代码示例和解释。此外,还涵盖了如何使用这些信息进行身份验证或注册保护。 ... [详细]
  • 基因组浏览器中的Wig格式解析
    本文详细介绍了Wiggle(Wig)格式及其在基因组浏览器中的应用,涵盖variableStep和fixedStep两种主要格式的特点、适用场景及具体使用方法。同时,还提供了关于数据值和自定义参数的补充信息。 ... [详细]
  • 根据最新发布的《互联网人才趋势报告》,尽管大量IT从业者已转向Python开发,但随着人工智能和大数据领域的迅猛发展,仍存在巨大的人才缺口。本文将详细介绍如何使用Python编写一个简单的爬虫程序,并提供完整的代码示例。 ... [详细]
  • moment 国际化设置中文语言 (全局) 及使用示例 ... [详细]
  • 本题探讨如何通过最大流算法解决农场排水系统的设计问题。题目要求计算从水源点到汇合点的最大水流速率,使用经典的EK(Edmonds-Karp)和Dinic算法进行求解。 ... [详细]
  • 混合云架构在本地与云服务间寻求平衡的有效性探讨
    随着云计算技术的发展,混合多云架构因其灵活性和高效性而备受关注。本文将深入探讨混合多云(简称混合云)如何通过结合本地基础设施与云端资源,为企业提供一个更为平衡且高效的IT解决方案。 ... [详细]
  • 远程访问用户 Kindle通过电子书实现控制
    介绍自2007年以来,亚马逊已售出数千万台Kindle,令人印象深刻。但这也意味着数以千万计的人可能会因为这些Kindle中的软件漏洞而被黑客入侵。他 ... [详细]
  • 流处理中的计数挑战与解决方案
    本文探讨了在流处理中进行计数的各种技术和挑战,并基于作者在2016年圣何塞举行的Hadoop World大会上的演讲进行了深入分析。文章不仅介绍了传统批处理和Lambda架构的局限性,还详细探讨了流处理架构的优势及其在现代大数据应用中的重要作用。 ... [详细]
  • 图数据库与传统数仓实现联邦查询使用CYPHER实现从关系数据库过滤时间序列指标一、MySQL得到研报实体在Oracle中的唯一ID二、Oracle中过滤时间序列数据三、CYPHER ... [详细]
author-avatar
阳光明媚-在路上
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有