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
Convert This String to Timestamp PHP
Php: Variable-Length Argument List by Reference
How to Set the Value of a Textbox Through PHP
Reply-To Address in PHP Contact Form
Separate String in Two by Given Position
How to Get an Option Previously Set with Curl_Setopt()
Phpseclib - How to Connect Using Username, Key and Password (Not a Key Passphrase)
How to Access Element Attributes with Simplexml
Phpmailer Error: Smtp -> Error: Failed to Connect to Server
Strtolower() for Unicode/Multibyte Strings
What Do \R and \N Mean in PHP (And Other Languages)
Ssl Error Can Not Change to Tls
Perl Equivalent of PHP's Escapeshellarg
How to Solve "Non-Static Method Xxx:Xxx() Should Not Be Called Statically in PHP 5.4
Discount for Certain Category Based on Total Number of Products