Newbie Help? Modifying email "from" in PHP
Posted: Sat Nov 21, 2009 1:33 pm
Hey Guys and Gals,
I really need some help. I've got this process.php code below working fine for me to send out the form emails. The only problem is whenever a visitor to my site submits a form from my server it places a "Nobody" in the "From" of the emails sent out. This presents a lot of "failed to deliver" issues. I'm hoping one of you brilliant PHPers can tell me how can I change the "Nobody" to something else - my email address or the website address, or what have you. Help?
Here is my process.php code:
--------------
<?php
$where_form_is="http://".$_SERVER['SERVER_NAME'].strrev(strstr(strrev($_SERVER['PHP_SELF']),"/"));
mail ("name@website.com," . $_POST['ListRecipients'] . "","" . $_POST['Name'] . " sent this message to you.","" . $_POST['Name'] . " would like to let you know...
");
header("Refresh: 0;url=http://www.website.com");
?>
-------------
Many thanks in advance,
Andy
I really need some help. I've got this process.php code below working fine for me to send out the form emails. The only problem is whenever a visitor to my site submits a form from my server it places a "Nobody" in the "From" of the emails sent out. This presents a lot of "failed to deliver" issues. I'm hoping one of you brilliant PHPers can tell me how can I change the "Nobody" to something else - my email address or the website address, or what have you. Help?
Here is my process.php code:
--------------
<?php
$where_form_is="http://".$_SERVER['SERVER_NAME'].strrev(strstr(strrev($_SERVER['PHP_SELF']),"/"));
mail ("name@website.com," . $_POST['ListRecipients'] . "","" . $_POST['Name'] . " sent this message to you.","" . $_POST['Name'] . " would like to let you know...
");
header("Refresh: 0;url=http://www.website.com");
?>
-------------
Many thanks in advance,
Andy