Send Mail Using Amazon EC2 Instance

巧了我就是萌 提交于 2019-12-09 04:15:30

问题


I am using Amazon EC2 Instance for one of my project, I have installed LAMP on linux server and now while I am trying to send email using simple function it is not sending email also is not giving any error for that.

Things I have done so far.

  • Created SES account.
  • Used simple mail function.
  • Enabled port 25 in security groups.

回答1:


Although your problem relates to Sendmail have you tried following Amazons Documentation?

http://docs.aws.amazon.com/ses/latest/DeveloperGuide/send-email-smtp-app.html

This uses postfix but it seems like a better alternative and there's help readily available for it.

You also can use SMTP as Amazon SES supports this:

http://docs.aws.amazon.com/ses/latest/DeveloperGuide/send-email-smtp.html

I know this doesn't directly answer your question. You might just need to configure the mail settings in php.ini.




回答2:


I solved this issue just by installing sendmail in my instance. Just run bellow command in your terminal

sudo apt-get install sendmail

That worked for me




回答3:


If you are using a amazon ec2 ami/linux distro use "sudo yum install sendmail" while in SSH




回答4:


If you are using AWS SES you need to make sure you validate the account first:

http://docs.aws.amazon.com/ses/latest/DeveloperGuide/verify-email-addresses.html

With the exception of addresses containing labels (see below), you must verify each email address that will be used as a "From" or "Return-Path" address for your messages. The entire email address is case-sensitive. For example, if you verify sender@example.com, you cannot send emails from sender@EXAMPLE.com unless you verify sender@EXAMPLE.com also. (Domain verification, however, is case-insensitive. For more information, see Verifying Domains in Amazon SES.)

Until you are granted production access to Amazon SES, you must also verify the email address of every recipient except for the recipients provided by the Amazon SES mailbox simulator. For more information about the mailbox simulator, see Testing Amazon SES Email Sending. For more information about production access, see Requesting Production Access to Amazon SES.



来源:https://stackoverflow.com/questions/19858457/send-mail-using-amazon-ec2-instance

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