0

Recently I have setup a website on an Amazon EC2 instance but I'm having some issues with sendmail (PHP's built-in PHP mail() function particularly.)

When I send an email to a Hotmail address for example, it works perfectly fine, although it is received within the junk folder, but if I try to send an email to and from my own domain like so (using info@mydomain.com as a placeholder):

mail('info@mydomain.com','Subject Line','Message');

The email does not reach my inbox, nor is it in my junk folder. The maillog within the system states the following:

Nov 16 22:52:15 ip-172-31-Nov 16 22:52:15 ip-172-xx-x-xxx sendmail[11667]: xAGMqFe0011667: to=info@mydomain.com, ctladdr=apache (48/48), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30111, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (xAGMqFDk011668 Message accepted for delivery)

Nov 16 22:52:36 ip-172-xx-x-xxx sendmail[11670]: STARTTLS=client, relay=zeus.pixeno.com., version=TLSv1/SSLv3, verify=FAIL, cipher=ECDHE-RSA-AES256-GCM-SHA384, bits=256/256

Nov 16 22:52:56 ip-172-xx-x-xxx sendmail[11670]: xAGMqFDk011668: to=, ctladdr= (48/48), delay=00:00:41, xdelay=00:00:41, mailer=esmtp, pri=120451, relay=zeus.pixeno.com. [185.67.45.160], dsn=5.1.1, stat=User unknown

Nov 16 22:52:56 ip-172-xx-x-xxx sendmail[11670]: xAGMqFDk011668: xAGMquDk011670: DSN: User unknown

Can anyone shed any light on this? I am sending and receiving emails as normal from mail clients without issue. It's just the PHP mail() that is a problem for me right now.

NOTE: The emails are hosted on an external server. The website where I am sending the emails from using PHP mail() function is on an Amazon EC2 instance.

Thank you!

Vishal Tarkar
  • 808
  • 11
  • 32
  • Does this answer your question? [PHP mail function doesn't complete sending of e-mail](https://stackoverflow.com/questions/24644436/php-mail-function-doesnt-complete-sending-of-e-mail) – miken32 Nov 17 '19 at 04:11
  • Unfortunately not. I tried everything within that thread for PHP mail() and nothing worked. Still not sending to the email to and from my domain. Baffled by this. – mcmaster.1986 Nov 17 '19 at 19:00

0 Answers0