tags:

views:

26

answers:

2

hi, i have been asked the php mail() function, is it send from linux ?or is it depend where the source code reside ?

A: 

It is sent from your server; if it's Linux, Linux will send it, if it's Windows, Window's will send it. If you want to use a different server to send your mail look into SMTP

Ashley
Windows doesn't have its own MTA, so mail() uses the PHP-preconfigured SMTP server.
stillstanding
+1  A: 

See the documentation on mail().

On Linux, the local sendmail binary is used.

On Windows, where there is no such binary, you need to specify a (local or remote) SMTP server to send out E-Mail (See the "Windows" comments in the documentation.)

For anything more complex - like using SMTP with authentication, or a remote SMTP server, sending out many mails at once, handling attachments etc. there are powerful PHP libraries like Swiftmailer that can totally circumvent the mail() command. It is often a good idea to use one of those from the start.

Pekka