Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
110 views
in Technique[技术] by (71.8m points)

php - AWS Server is not sending email to outside the domain

In our Magento website, it is not sending email to the outside domain. For example, a website is ads.com, and if a customer order a product & customer mail id is [email protected], but he didn't get email. But I am getting a copy of the email [[email protected]]

If the customer's mail id is [email protected] then the customer is getting an email. That means the only @ads.com only getting the email. Why this happens. Our website is hosted on an AWS server.

I just create a sample PHP file in domain root and write the mail function. But still, no email is going outside ads.com. Then I added

"-f ".$from in the code then the mail is sending to any email id without any issue.

$from='[email protected]';
$headers .= 'From: <[email protected]>' . "
";
mail($to,$subject,$message,$headers, "-f ".$from);

Please help to solve the issue.

When I am sending emails to another email example gmail.com or yahoo.com or anyotherdomain.com I am getting the following error.

Jan 29 11:50:20 ip-232-11-99-372 sendmail[19122]: 10TBoIjU019120: [email protected], [email protected] (500/500), delay=00:00:02, xdelay=00:00:02, mailer=esmtp, pri=171765, relay=gmail-smtp-in.l.google.com. [74.125.24.27], dsn=5.0.0, stat=Service unavailable

question from:https://stackoverflow.com/questions/65936970/aws-server-is-not-sending-email-to-outside-the-domain

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

AWS blocks outbound traffic on port 25 (SMTP) of all EC2 instances and Lambda functions by default. If you want to send outbound traffic on port 25, you can request for this restriction to be removed. https://aws.amazon.com/premiumsupport/knowledge-center/ec2-port-25-throttle/


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...