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 [email protected]
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=<[email protected]>, relay=andreas@localhost
Apr 7 01:16:21 Andreas-PC-Ubuntu sm-mta[11760]: q36NGL1J011760: from=<[email protected]>, size=299, class=0, nrcpts=1, msgid=<[email protected]>, proto=ESMTP, daemon=MTA-v4, relay=ip6-localhost [127.0.0.1]
Apr 7 01:16:21 Andreas-PC-Ubuntu sendmail[11759]: q36NGIfD011759: [email protected], 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.
[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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With