SMTP on Apache, how can I get it to work?

I’m trying to send emails from mail() scripts on my new local WAMP installation, but it’s not working.

I have a Windows XP, Apache 2.x, PHP 5.x installation and haven’t been able to get the mail function to work.

Do I have to make sure that certain modules/extensions are installed before this can work? Some advice I’ve seen has said to use my ISP mail settings in php.ini , but then where can username and passwords go? Does this advice mean that there isn’t actually an SMTP server installed automatically with Apache?

I would prefer that I could get a solution that would mean the mail() function would work. Hope someone can help.

[to mods: This is a PHP problem rather than an Apache problem, so ideally this post should be moved.]

You need to either setup a local SMTP server (I don’t know if your WAMP setup includes one) or you can use your ISPs one.

Either way you need to configure the PHP mail handling section in the php.ini file to use your SMTP server.

See the Runtime Configuration section of the mail() function at the PHP manual.

HR,

Thanks for the move and correct info.

Googly,

Search in your php.ini file for the “[mail function]” where you should, if you’re using WinDoze, find something like:[indent]; For Win32 only.
SMTP = localhost
smtp_port = 25[/indent]That will take care of your problem for you.

Regards,

DK