Re: mail function
| From: | Jim Pazarena | Date: | Fri, 03 Oct 2014 18:19:49 +0000 |
| Subject: | Re: mail function | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-323902@lists.php.net to get a copy of this message | ||
On 2014-10-03 10:40, Jim Pazarena wrote:
> when I generate an email using the mail() function, my message body
> ALWAYS has the sending/from address
> included as the first line of the message body. I am not putting it in
> my message body, yet there it is.
> Any clues would be appreciated.
> server is exim, altho I can't see exim doing it.
> Thanks!
>
> ps. only getting into php recently. 'Been in 'c' for years. I really
> like php. Flexibility! Power!
attached is short source along with complete email output
Thanks!
--
Jim Pazarena 250.559.7777
www.haidagwaii.net/paz/
<? $islocal = 1; if ($islocal) { $raddr = "23.235.68.254"; $subject_line = "testing email"; $to = "php@paz.bz"; $from = "webmaster@paz.bz"; $envelope_sender = "-f=<$from>"; $hit_date = date("Y-m-d H:i:s"); $exec_string = "/u/bin/cust " . $raddr; exec ($exec_string, $result, $rval); if ($result[0]) $cust = $result[0]; else $cust = "... unknown"; $message_body = "$subject_line\n$hit_date\n$raddr - $cust\n"; mail($to,$subject_line,$message_body,$from,$envelope_sender); } ?> ABOVE IS THE PHP SOURCE BELOW IS THE ENTIRE EMAIL GENERATED. Return-path: <webmaster@paz.bz> Envelope-to: php@paz.bz Delivery-date: Fri, 03 Oct 2014 11:13:52 -0700 Received: from 4-72-235-23.qcislands.net ([23.235.72.4] helo=door.qcislands.net) by mail.qcislands.net with esmtp (Exim 4.82) (envelope-from <webmaster@paz.bz>) id 1Xa7MW-0003jG-7Q for php@paz.bz; Fri, 03 Oct 2014 11:13:52 -0700 Received: from pgmr by door.qcislands.net with local (Exim 4.82) (envelope-from <webmaster@paz.bz>) id 1Xa7MM-00089w-52 for php@paz.bz; Fri, 03 Oct 2014 11:13:42 -0700 To: php@paz.bz Subject: testing email X-PHP-Originating-Script: 1003:zz.php Message-Id: <E1Xa7MM-00089w-52@door.qcislands.net> From: webmaster@paz.bz Date: Fri, 03 Oct 2014 11:13:42 -0700 webmaster@paz.bz testing email 2014-10-03 11:13:42 23.235.68.254 - paz-router
<? $islocal = 1; if ($islocal) { $raddr = "23.235.68.254"; $subject_line = "testing email"; $to = "php@paz.bz"; $from = "webmaster@paz.bz"; $envelope_sender = "-f=<$from>"; $hit_date = date("Y-m-d H:i:s"); $exec_string = "/u/bin/cust " . $raddr; exec ($exec_string, $result, $rval); if ($result[0]) $cust = $result[0]; else $cust = "... unknown"; $message_body = "$subject_line\n$hit_date\n$raddr - $cust\n"; mail($to,$subject_line,$message_body,$from,$envelope_sender); } ?> ABOVE IS THE PHP SOURCE BELOW IS THE ENTIRE EMAIL GENERATED. Return-path: <webmaster@paz.bz> Envelope-to: php@paz.bz Delivery-date: Fri, 03 Oct 2014 11:13:52 -0700 Received: from 4-72-235-23.qcislands.net ([23.235.72.4] helo=door.qcislands.net) by mail.qcislands.net with esmtp (Exim 4.82) (envelope-from <webmaster@paz.bz>) id 1Xa7MW-0003jG-7Q for php@paz.bz; Fri, 03 Oct 2014 11:13:52 -0700 Received: from pgmr by door.qcislands.net with local (Exim 4.82) (envelope-from <webmaster@paz.bz>) id 1Xa7MM-00089w-52 for php@paz.bz; Fri, 03 Oct 2014 11:13:42 -0700 To: php@paz.bz Subject: testing email X-PHP-Originating-Script: 1003:zz.php Message-Id: <E1Xa7MM-00089w-52@door.qcislands.net> From: webmaster@paz.bz Date: Fri, 03 Oct 2014 11:13:42 -0700 webmaster@paz.bz testing email 2014-10-03 11:13:42 23.235.68.254 - paz-router