Contact Us Forum Rules Search Archive
WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox Mark Forums Read

Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-02-2005, 03:20 PM
jawn_tech's Avatar
Moderator
WebProWorld Moderator
 

Join Date: Jun 2004
Location: USA
Posts: 1,860
jawn_tech RepRank 2
Default PHP mail question

After setting up a form using PHP to email me the form contents, of course the sender address displays as a www address coming from the server.

I need to build another form with a different recipient, and I want to be able to rename the sender just for display purposes in the recipient's email inbox. Know what I mean? In other words, sometimes you see your email arrive as being from "John Doe" instead of "johndoe@xyz.com". I want to have the php-sent email arrive in our inbox as "Feedback Form" instead of "www.serveraddress.web.host.abcdefg..."

Is there a PHP command that does this?
Reply With Quote
  #2 (permalink)  
Old 02-02-2005, 03:53 PM
jawn_tech's Avatar
Moderator
WebProWorld Moderator
 

Join Date: Jun 2004
Location: USA
Posts: 1,860
jawn_tech RepRank 2
Default

Cool - problem solved already, so I'll post the solution in case anyone else was wondering how to do this.

In your PHP's mail() command line, you can add a $header variable.

Code:
$header = "From: Feedback User <companyname@company.net>";
Then include it in your mail command.

Code:
mail($toaddress, $subject, $mailcontent, $header);
This way, when you co-worker opens her email, in Outlook for example (outlook...blech), she will see "Feedback User" displayed as the sender.

I don't know why it wasn't working for me without the <> part. Well, at least it works.
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Tags: , ,



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Search Engine Optimization by vBSEO 3.2.0