简体   繁体   中英

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 test@gmail.com, but he didn't get email. But I am getting a copy of the email [myemail@ads.com]

If the customer's mail id is new@ads.com 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='no-reply@ads.com';
$headers .= 'From: <no-reply@ads.com>' . "\r\n";
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: to=mygamil@gmail.com, ctladdr=ec2-user@ip-232-11-99-372.ap-north-1.compute.internal (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

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/

You could be on a DNS blacklist. This sounds very similar to an issue at an organization I volunteered at.

This is basically like "marked as spam" but at the server level, so Gmail (et al) would prevent the email from even going into the recipient's spam folder.

You can verify this by looking at the bounce details for the emails you send. If this is the case, then you would have to contact the email providers (eg Google) to get you removed from the blacklist.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM