note 43223 added to function.mail

From: Date: Mon, 14 Jun 2004 18:43:48 +0000
Subject: note 43223 added to function.mail
Groups: php.notes 
Request: Send a blank email to php-notes+get-71060@lists.php.net to get a copy of this message
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. ---- Manual Page -- http://www.php.net/manual/en/function.mail.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+43223 Delete -- http://master.php.net/manage/user-notes.php?action=delete+43223&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+43223&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#71060) next »