简体   繁体   中英

Sendmail issue: successfully sent but never arrives

I'm trying to send mail via the PHP mail() function which as far as I have understood uses sendmail to deliver the goods. Now my problem is that mail() returns true but there is not even a trace of the mail in my mailbox (yea i checked spam too).

So i tried to send some mail manually from the terminal but the problem persists. sendmail does not give me an error, except from a unable to determine domain error which i fixed by adding the domain for my dev-machine to /etc/hosts and related it to 127.0.0.1.

andreas@Andreas-PC-Ubuntu:~$ sendmail xxxxxxx@xxxxxxx.com
Test
.
andreas@Andreas-PC-Ubuntu:~$

As well as giving no error, sendmail logs that the mail was sent successfully in /var/log/mail.log:

Apr  7 01:16:21 Andreas-PC-Ubuntu sendmail[11759]: q36NGIfD011759: from=andreas, size=5, class=0, nrcpts=1, msgid=<201204062316.q36NGIfD011759@home.hagenz.com>, relay=andreas@localhost
Apr  7 01:16:21 Andreas-PC-Ubuntu sm-mta[11760]: q36NGL1J011760: from=<andreas@home.hagenz.com>, size=299, class=0, nrcpts=1, msgid=<201204062316.q36NGIfD011759@home.hagenz.com>, proto=ESMTP, daemon=MTA-v4, relay=ip6-localhost [127.0.0.1]
Apr  7 01:16:21 Andreas-PC-Ubuntu sendmail[11759]: q36NGIfD011759: to=xxxxxxx@xxxxxxx.com, ctladdr=andreas (1000/1000), delay=00:00:03, xdelay=00:00:00, mailer=relay, pri=30005, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (q36NGL1J011760 Message accepted for delivery)

So yea, any suggestions?

Are you sure the recipient SMTP server isn't dropping (or at least greylisting) your mail? It's very common for mail servers to treat messages not coming from a recognized MX server as being spammy.

Is sendmail configured to use an SMTP relay/smarthost? If not, what happens if you configure it to use your ISP's, employer's, or other hosting provider's server?

have you set up the configuration in your php.ini file?

When i setup php on my own server (I was running IIS on server 2003, with Exchange for emails), I had to edit the php.ini file to configure the Mail function.

Just had to uncomment andspecify my mail server for the SMTP part.

Edit

[mail function]; For Win32 only. ; http://php.net/smtp SMTP = #mymailserver#; http://php.net/smtp-port smtp_port = 25

You will probably have to do the same, or similar, depending on your web server environment

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