note 11061 deleted from function.mail by jimw

From: Date: Wed, 31 Oct 2001 23:12:35 +0000
Subject: note 11061 deleted from function.mail by jimw
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-19894@lists.php.net to get a copy of this message
Ok. I finally got this function to work for me, at least in-so-far as the From field in the email message to read properly. If you haven't gotten any of the above solutions to work for you, this one should. At least it does for me: function mailfrom($named,$fromaddress, $toaddress, $subject, $body, $headers) { $fp = popen('/usr/lib/sendmail -t -f '.$fromaddress.' '.$toaddress.' '.$subject,"w"); if(!$fp) return false; fputs($fp,"From:".$fromaddress.";\n\n "); fputs($fp, "To: $toaddress\n"); fputs($fp, "Subject: \"".$subject."\"\n"); fputs($fp, $headers."\n\n"); fputs($fp, $body); fputs($fp, "\n"); pclose($fp); return true; } the key of course, is this line: ($fp,"From:".$fromaddress.";\n\n "); this should work also, if you don't want to use a functtion: $from="From:".$from.";\n\n"); The subject field is still blank, something no one has addressed here, so how about it. Anyone know what to do about a blank subject field? max

« previous php.notes (#19894) next »