Send emails from AWS EC2 instance (SES mandatory?)

前端 未结 2 1693
挽巷
挽巷 2020-12-09 07:01

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

This is related with this other post Rails do

2条回答
  •  粉色の甜心
    2020-12-09 07:42

    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

提交回复
热议问题