note 43223 deleted from function.mail by aidan
| From: | aidan@php.net | Date: | Mon, 14 Feb 2005 02:21:00 +0000 |
| Subject: | note 43223 deleted from function.mail by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-84963@lists.php.net to get a copy of this message | ||
Note Submitter: ms at nospam dot ventersciencejtc dot org
----
I found the Warning about Windows vs. Unix somewhat misleading. From examining the source code in
ext/standard/mail.c in php 4.3.7, it appears that the rule is as follows:
Windows:
If the INI parameter "sendmail_path" is NULL, it will hand off the mail to the server
specified by the INI parameter "SMTP". But if you set "sendmail_path", it WILL
use a local program for mail delivery. It runs the mail program with popen(...,"wb"). [
I didn't try this -- I figured it out by examining the code. ]
Unix:
You can ONLY send mail through a local delivery program. The assumption appears to be that
everybody with Unix wants to run a local MTA. If that is not the case, you can either use a
function like the one somebody posted below, or you can write a trivial external MTA that hands off
the mail to your SMTP server. Python and perl both contain suitable SMTP mail functions. Be sure
to set the value of "sendmail_path" in the INI file because ini_set() does not allow you
to change this parameter.