无法通过php邮件,AWS ubuntu实例,sendmail发送邮件

I have AWS ubuntu instance. I am trying to send simple mail through PHP mail function. Mail function returns true but mail is not delivered neither to gmail nor to my host. I also tried sending email through command but that also doesnt work. I am attaching sendmail service status here. Kindly help me to fix this problem.

  1. sendmail status for gmail:

Nov 12 14:41:23 ip-172-31-51-198 sm-mta[21446]: STARTTLS=client, relay=gmail-smtp-in.l.google.com., version=TLSv1.2, verify=FAIL, cipher=ECDHE-RSA-AES128-GCM-SHA256, bits=128/128 Nov 12 14:41:23 ip-172-31-51-198 sm-mta[21446]: wACJfNOM021444: to=<mymail@gmail.com>, ctladdr=<www-data@ip-172-31-51-198.ec2.internal> (33/33), delay=00:00:00, xdelay=00:00:00, mailer=esmtp, Nov 12 14:41:23 ip-172-31-51-198 sm-mta[21446]: wACJfNOM021444: wACJfNOM021446: DSN: Service unavailable Nov 12 14:41:23 ip-172-31-51-198 sm-mta[21446]: wACJfNOM021446: to=<www-data@ip-172-31-51-198.ec2.internal>, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=30000, dsn=2.0.0, stat=Sent

  1. send mail status for mydomain.com

    Nov 12 14:40:02 ip-172-31-51-198 systemd[1]: Stopped LSB: powerful, efficient, and scalable Mail Transport Agent. Nov 12 14:40:02 ip-172-31-51-198 systemd[1]: Starting LSB: powerful, efficient, and scalable Mail Transport Agent... Nov 12 14:40:02 ip-172-31-51-198 sendmail[21348]: * Starting Mail Transport Agent (MTA) sendmail Nov 12 14:40:02 ip-172-31-51-198 sm-mta[21388]: starting daemon (8.15.2): SMTP+queueing@00:10:00 Nov 12 14:40:04 ip-172-31-51-198 sendmail[21348]: ...done. Nov 12 14:40:04 ip-172-31-51-198 systemd[1]: Started LSB: powerful, efficient, and scalable Mail Transport Agent. Nov 12 14:40:17 ip-172-31-51-198 sm-mta[21408]: wACJeHlI021408: <myemail@mydomain.com>... User unknown Nov 12 14:40:17 ip-172-31-51-198 sm-mta[21408]: wACJeHlI021408: from=<www-data@ip-172-31-51-198.ec2.internal>, size=596, class=0, nrcpts=0, proto=ESMTP, daemon=MTA, relay=localhost [127.0.0.1] Nov 12 14:40:17 ip-172-31-51-198 sm-mta[21408]: wACJeHlK021408: from=<>, size=2592, class=0, nrcpts=1, msgid=<201811121940.wACJeHpa021407@ip-172-31-51-198.ec2.internal>, proto=ESMTP, daemon=MTA, r Nov 12 14:40:17 ip-172-31-51-198 sm-mta[21409]: wACJeHlK021408: to=<www-data@ip-172-31-51-198.ec2.internal>, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=32835, dsn=2.0.0, stat=Sent

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问