Simple PHP Mail Function Not Working on Amazon Server Ec2

Simple PHP Mail function not working on Amazon server EC2

I'd had the same issue as you in sending an email using Php's mail(). Installing send mail solved it for me.

sudo apt-get install sendmail

EC2 - Fresh PHP install - Mail not working

This won't directly solve your issue (edit: I mean the error message you have now edited out), but Amazon EC2 instances have a really spotty mail reputation. You're probably going to have deliverability issues.

Thankfully Amazon created the Simple Email Service to go along with EC2, with a free level of service for EC2 customers. The API is pretty simple and there are transport adapters for many excellent PHP mailing libraries, like SwiftMailer (transport).

Failed sending mail EC2-PHP with SendMail

If you are getting result "true" always then your emails might be blocked by Spamhaus. So the best way is to send email from an ec2 instances is to set relay email to different mail server. You can send 200 emails per day for free using sendgrid. Otherwise you can send email using smtp authentication. Here is an example using gmail smtp server.

Unable to send PHP email via amazon EC2

If you are using aws free tier then you have to subscribe to SES - Amazon Simple Email Service (https://aws.amazon.com/ses/). I too faced this problem.



Related Topics



Leave a reply



Submit