Send emails from AWS EC2 instance (SES mandatory?)

和自甴很熟 提交于 2019-11-28 07:49:48

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

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.

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)

Seb

As sebasto wrote, sending emails is limited.

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

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

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!