简体   繁体   中英

Can't send mail with PHP mail() in Ubuntu Server 16.04 (postfix)

I am trying, for a Wordpress installation, to have my server (Ubuntu Server 16.04/postfix hosted in Azure) send emails via mail() PHP function (at the moment I can't use SMTP for various reasons).

1) When i call mail() the response is true

2) I opened port 25 on Azure Network Security Group

3) This is the postfix log

Oct 17 11:15:20 server-name postfix/pickup[17340]: EEEFB17A2C7: uid=33 from=<www-data>
Oct 17 11:15:20 server-name postfix/cleanup[20035]: EEEFB17A2C7: message-id=<20171017091520.EEEFB17A2C7@server-name.nymtaaoecewufefh442h0i5f5d.ax.internal.cloudapp.net>
Oct 17 11:15:21 server-name postfix/qmgr[1681]: EEEFB17A2C7: from=<www-data@server-name.nymtaaoecewufefh442h0i5f5d.ax.internal.cloudapp.net>, size=505, nrcpt=1 (queue active)
Oct 17 11:15:21 server-name postfix/error[20038]: EEEFB17A2C7: to=<username@mydomain.com>, relay=none, delay=0.13, delays=0.09/0/0/0.04, dsn=5.0.0, status=bounced (mydomain.com)
Oct 17 11:15:21 server-name postfix/cleanup[20035]: 10DB817A2C8: message-id=<20171017091521.10DB817A2C8@server-name.nymtaaoecewufefh442h0i5f5d.ax.internal.cloudapp.net>
Oct 17 11:15:21 server-name postfix/qmgr[1681]: 10DB817A2C8: from=<>, size=2891, nrcpt=1 (queue active)
Oct 17 11:15:21 server-name postfix/bounce[20039]: EEEFB17A2C7: sender non-delivery notification: 10DB817A2C8
Oct 17 11:15:21 server-name postfix/qmgr[1681]: EEEFB17A2C7: removed
Oct 17 11:15:21 server-name postfix/local[20041]: 10DB817A2C8: to=<www-data@server-name.nymtaaoecewufefh442h0i5f5d.ax.internal.cloudapp.net>, relay=local, delay=0.07, delays=0.04/0.01/0/0.03, dsn=2.0.0, status=sent (delivered to mailbox)
Oct 17 11:15:21 server-name postfix/qmgr[1681]: 10DB817A2C8: removed

Can you help me find the problem?

Thank you very much.

Ok, I solved the problem. I didn't configure postfix as "Internet Site".

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