I’m setting up an Win 7 laptop with localhost for web site development. Apache, PHP and MySQL work fine, but I can’t send e-mails from my forms. When I try I get the following message:
Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.inii or use ini_set() in C:\\websites\\lib\\classes\\Transport\\SimpleMailInvoker.php on line 50
I have checked php.ini, of course, it’s the same as on my WinXP machine.
My WinXP computer does this with no problem; it has an XAMPP all-in-one installation including ‘MercuryMail’ and a folder called ‘Sendmail’ that just contains ‘sendmail.exe’ and ‘sendmail.ini’. I’ve never confirgured the MercuryMail, and I suspect it’s the ‘Sendmail’ that’s doing the job, but I’m not sure.
Do I also need to install a Mail Server go alongside Apache ? I don’t necessarily need anytihng very complex, just the minimum to enable me to send e-mails from the pages hosted locally on Apache.
Thanks. I’ve checked out the link, and it appears to be a dummy server that just checks that the mail is configured properly. I’d prefer to send it for real.
But I think you must be right about needing an SMTP server. It’s a long time since I configured my WinXP system, and I’ve forgotten what I did.
Yes, either sendmail OR setup PHP to use your POP3/IMAP server. That’s more a PHP question than Apache but I’m glad that you found the answer.
WARNING: sendmail is known to have security problems so check their website to be sure that you have the latest version - OR just use your POP3/IMAP server (via the Internet).
Thanks. I set out not really sure if it was an Apache matter or only PHP. As you say, turned out it was PHP. I’ll heed the security warning. The version of Sendmail I’m using on my WinXP machine is certainly quite old (and I just copied it onto my Win7 laptop).