nadz Posted April 15, 2007 Share Posted April 15, 2007 what i mean is when the person reads the email i sent them through my sendmail form it just shows the email address i am choosing to display: From: [email protected] but i want it to show: From: <[email protected]> My Name i think its really simple but im a total noob. Link to comment https://forums.phpfreaks.com/topic/47159-sendmail-how-do-i-get-my-name-next-to-my-email-address/ Share on other sites More sharing options...
anthylon Posted April 16, 2007 Share Posted April 16, 2007 Try this: $to = 'Your Name <[email protected]>'; Link to comment https://forums.phpfreaks.com/topic/47159-sendmail-how-do-i-get-my-name-next-to-my-email-address/#findComment-229997 Share on other sites More sharing options...
nadz Posted April 16, 2007 Author Share Posted April 16, 2007 thank for the reply, now to make it slightly more complicated, the emails are sent by different users so im using this as the "from" header in the form: $from = trim($_POST['sender']); where the user supplies the email address they want it to be from. The name of the person sending it is defined by $_POST['name'] so I tried this: $from = $_POST['name'] <trim($_POST['sender'])>; and $from = trim($_POST['name']) <trim($_POST['sender'])>; and i got this error: Parse error: syntax error, unexpected '>' in /home/.loekie/nexman/*********.co.uk/import/import.php on line 108 Link to comment https://forums.phpfreaks.com/topic/47159-sendmail-how-do-i-get-my-name-next-to-my-email-address/#findComment-230022 Share on other sites More sharing options...
techiefreak05 Posted April 16, 2007 Share Posted April 16, 2007 Try this, I havent tested it, but I'm pretty sure it should work: $from = trim($_POST['name']) . " <" . trim($_POST['sender']) . ">"; Link to comment https://forums.phpfreaks.com/topic/47159-sendmail-how-do-i-get-my-name-next-to-my-email-address/#findComment-230063 Share on other sites More sharing options...
nadz Posted April 16, 2007 Author Share Posted April 16, 2007 wow thanks alot techiefreak05 (and anthylon), it worked. appreciated very much. Link to comment https://forums.phpfreaks.com/topic/47159-sendmail-how-do-i-get-my-name-next-to-my-email-address/#findComment-230279 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.