note 43683 added to function.mail
| From: | phpnetnoteatiamxdotnl at rn2 dot php dot net | Date: | Wed, 30 Jun 2004 08:14:18 +0000 |
| Subject: | note 43683 added to function.mail | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-72160@lists.php.net to get a copy of this message | ||
I had some trouble figuring out how to change the default Return-Path when a form was submitted and
mailed to a little program I run on my server that really needs a "real" Return-path.
Finally I came to this solution:
<?
ini_set(sendmail_from, $submitted_email);
mail("$reciever", "$subject", "$body",
"From: $submitted_email\\r\\n
Reply-to: $submitted_email\\r\\n
X-Mailer: A nice little mailer\\r\\n");
ini_restore(sendmail_from);
?>
What it does is temporarly set the Default sendmail_from email address to the submitted email
address and then after the mail action has been completed, it set's it back to the default that
has been assigned in the httpd.conf.
This is very efficient if you don't have root/conf access.
----
Manual Page -- http://www.php.net/manual/en/function.mail.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+43683
Delete -- http://master.php.net/manage/user-notes.php?action=delete+43683&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+43683&report=yes
Search -- http://master.php.net/manage/user-notes.php