barrowvian Posted May 16, 2010 Share Posted May 16, 2010 i have a contact form on my website, when someone uses it the 'from' field in the email just states that its come from my website (more specifically my username from my hosting account). Is there a way to change it to display the name or email address of the person that has submitted the form? Link to comment https://forums.phpfreaks.com/topic/201982-changing-the-from-element-of-an-email/ Share on other sites More sharing options...
kenrbnsn Posted May 17, 2010 Share Posted May 17, 2010 Please post your code. Ken Link to comment https://forums.phpfreaks.com/topic/201982-changing-the-from-element-of-an-email/#findComment-1059319 Share on other sites More sharing options...
litebearer Posted May 17, 2010 Share Posted May 17, 2010 could try this... <?php $to = 'user@domain.com'; $subject = 'Subject'; $message = 'This is a test'; $headers = 'From: webmaster@yourdot.com' . "\r\n" . 'Reply-To: webmaster@yourdot.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); ?> Link to comment https://forums.phpfreaks.com/topic/201982-changing-the-from-element-of-an-email/#findComment-1059330 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.