Howard
Howard

Reputation: 19805

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

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.

Upvotes: 4

Views: 3098

Answers (2)

Aditya
Aditya

Reputation: 396

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.

Upvotes: 8

Emyr
Emyr

Reputation: 2371

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

Upvotes: 1

Related Questions