Apache doesn't actually have anything to do with the mail. You need some sort of mail transfer agent to send the mail (something like sendmail or, my preference, postfix). mail(); simply generates a mail message but sends it through to the MTA, exiting on success with "true". It's up the how the MTA is configured, to take that input and turn it into an actual mail message.
Windows machines don't have an mail transfer agent on them, usually - unless you pay major money for one of Microsoft's "Super Dooper Server" versions, or something.Sending the job to localhost won't work, because on Windows there's usually nothing on localhost to do the job. So, if you are running on Windows, you need some third party machine to do the actual mail sending (not necessarily a Unix machine, although that'd be much cheaper, etc. - an Exchange Server machine will be just as good, from the point of view of sending the actual message - but either way, your own machine needs relay mail rights on that machine, so it's not something to embark about configuring lightly).
A Unix webhost, however, can have a variety of MTAs installed on it for free (this includes Mas OS X, of course). They will now be running locally, so you can refer the job to localhost, and PHP will send the job through to whatever mail transfer agent exists on localhost for execution.
|