note 1650 deleted from function.mail by jimw

From: Date: Wed, 31 Oct 2001 22:57:24 +0000
Subject: note 1650 deleted from function.mail by jimw
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-19840@lists.php.net to get a copy of this message
My rewrite of the mail function: function n_mail( $from, $to , $subject,$core_msg, $add_header) { $cmd_line=sprintf("/usr/sbin/sendmail -r %s -t",$from); $fp=popen($cmd_line,"w"); $temp=sprintf("To: %s\n",$to); $len=strlen($temp); $ret_p=fputs($fp,$temp,$len); $temp=sprintf("Subject: %s\n",$subject); $len=strlen($temp); $ret_p=fputs($fp,$temp,$len); if ($add_header != "") { $temp=sprintf("%s\n",$add_header); $len=strlen($temp); $ret_p=fputs($fp,$temp,$len); } $temp=sprintf("\n%s\n",$core_msg); $len=strlen($temp); $ret_p=fputs($fp,$temp,$len); pclose($fp); } There are no tests here ... not enought place but testing the returns is better ....

« previous php.notes (#19840) next »