tags:

views:

48

answers:

2

Do I need a SMTP server in using the PHP's mail() function?

p.s. I am on a share hosting account, so I cannot install a SMTP server and they don't provide that.

+1  A: 

PHP on Linux servers relies on a local MTA for the mail() function.

PHP on Windows can be configured to use whatever SMTP server you like.

PEAR::Mail allows you to set which SMTP server you want to use. http://pear.php.net/manual/en/package.mail.mail.intro.php

With the first parameter as 'smtp', the second param accepts details. http://pear.php.net/manual/en/package.mail.mail.factory.php

Emyr
ORLY? http://uk3.php.net/manual/en/function.mail.php That page only mentions sendmail.
Emyr
+4  A: 

PHP's mail() function doesn't need SMTP. It uses a program called sendmail which is generally available on Unix/Linux platforms by default and most web hosts provides this facility for no extra charge.

Aditya