Jump to content

[SOLVED] How can I make the email come from name AND email?


agentk

Recommended Posts

I have a contact form that sends emails to me with the customers email adress in the "from" section of the email, but it does not show the customers name.

 

$from = "From: $visitormail\r\n";

 

Example: When using the above code and someone makes a contact submission on the form, my email account tells me I got a notification from whatever the visitors email is. 

 

How can I make both - the name AND the email adress - appear?  I want it to look like the person sent me the email directly from their email inbox... with name and email showing... yet I want to also be able to just hit reply and send them a response without having to copy paste their email adress in the box.  Its my way of adding professionalism to my customer service ;)

 

Thanks so much in advance again... you guys are awesome!

Link to comment
Share on other sites

@ poster,

 

try this;

 

$headers = "From: $nameofuser<darius@yahoo.com>";

 

Note, the $nameofuser should be the value from the name in your form

 

<input type ="text" name="nameofuser" value="<?php print $nameofuser; ?>

 

Hope you solved.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.