Use default PHP mail function with SMTP server on Linux

I am working on a php / C # project, which is a mail server with a web interface for managing an email application.

The program is supposed to run on windows and linux, but I am mainly involved in Windows development.

I did not come for testing on Linux and found a terrible problem.

From what I was looking for in Windows PHP, you can choose the SMTP server you want to use, but it looks like you don't have this option on Linux, so when PHP sends an email, it completely bypasses my program.

Is there a way to get PHP to use the SMTP server of your choice, I know that you can use PEAR to override the SMTP settings, but I would prefer the standard PHP mail function to work, so that other software like the PHPBB forum send email mail through my SMTP server instead of the default mail.

Is this something that is possible, or is my only option to use a pear?

+6
source share
2 answers

The standard php mail function will only send what is defined as sendmail _path in php.ini

Usually this sendmail -t -i

You need to configure sendmail to use smtp.

FWIW, , PHP, () ( ), /.

, , PHP script , script, (, , mail() ).

+2

, mail() SMTP- , Windows.

. php.ini smtp.

phpmailer PHP . , SMTP SSL/TLS. ( - . Zend_Mail), SMTP.

, , - Pear.

+1

All Articles