Do I need an SMTP server when using the PHP mail () function

Do I need an SMTP server when using the PHP mail () function?

ps I am in the share hosting account, so I can not install the SMTP server, and they do not provide this.

+4
source share
2 answers

The PHP mail () function does not require SMTP. It uses a program called sendmail , which is usually available on Unix / Linux platforms by default, and most web hosts provide this service at no extra charge.

+8
source

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

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

PEAR :: Mail allows you to specify 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 parameter receives data. http://pear.php.net/manual/en/package.mail.mail.factory.php

+1
source

All Articles