I cant get the mail() to work not matter what I try. Ive used this successfully over the years but for some reason i just cant get it to work.
Ive tried the following from other questions around here:
ini_set( 'sendmail_from', "dev@localhost.com" ); // My usual e-mail address
ini_set( 'SMTP', "localhost.com" ); // My usual sender
ini_set( 'smtp_port', 25 );
(correct) php.ini
[mail function]
; XAMPP: Comment out this if you want to work with an SMTP Server like Mercury
SMTP = localhost.com
smtp_port = 25
I can ping localhost, localhost.com (used currently for email validatin on localdev) and 127.0.0.1
I have tried netstat and port 25 is "LISTENING" when server is running. I can send/receive mail from Live mail - but not PHP :( no errors either.
mail("dev@localhost.com", "subj", "test message");
Im running win7, tried with firewall off, last download xampp around Dec 2013 so php v is quite current. My folder is in D:\xampp not C - im not using sendmail but mail so it should just work from any directory. Ive also set the sendmail_from to a valid email to no avail...
And yes I have been restarting the webserver after each change.
Im running argosoft webserver free which ive used for a few years. As mentioned I can send mail form Live mail, just not from php file.