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? Quote 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 Quote 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 = '[email protected]'; $subject = 'Subject'; $message = 'This is a test'; $headers = 'From: [email protected]' . "\r\n" . 'Reply-To: [email protected]' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); ?> Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.