There is e-mail throttling on that instance. By default, Amazon EC2 restricts traffic on port 25 of all EC2 instances to protect customers and other recipients from spam and email abuse. So you will have to first make a request to remove the restriction on port 25 which is used by SMTP protocol to send and receive E-mails.
To request AWS to remove the port 25 restriction on your account:
1) Sign in with your AWS account, and open the Request to Remove Email Sending Limitations form.
2) In the Use Case Description field, provide a description of your use case.
3) (Optional) Provide the AWS-owned Elastic IP addresses that you use to send outbound emails as well as any reverse DNS records that AWS needs to associate with the Elastic IP addresses. With this information, AWS can reduce the occurrences of emails sent from the Elastic IP addresses being marked as spam.
4) Choose Submit.
If your request is approved, you'll receive an email to notify you that the port 25 restriction on your EC2 instances is removed.
For more information on this, you can refer: https://aws.amazon.com/premiumsupport/knowledge-center/ec2-port-25-throttle/
In case, even after port 25 throttle removal, if you are still not able to send E-mails, there might be issue with the send mail configuration.
Since you are using PHP mail function to send emails, I am sharing with you the third party link of PHP application. There are many variables within the PHP code. I have found this documentation page  from the official PHP website, that might help you to construct each part and have more explanation to it, and knowing more what are its requirements. I hope this would help you in writing the PHP function for sending mails.
Also, you might need to configure the PHP Configuration file (/etc/php.ini) , to send the emails. For more on this, you can refer: https://pepipost.com/tutorials/sendmail-in-php-complete-guide/
Please note that configuring Mail server is a system administration task and is beyond the scope of the support we provide. However, assistance provided to you is only on the best effort basis.