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 09-30-2008, 12:47 PM
WebProWorld New Member
 

Join Date: Sep 2008
Posts: 18
ryanhouston RepRank 0
Red face Email Inbox Error

Why does the emails in my inbox sent from my contact form have "nobody@gigenic.t55.us" and not what the user entered into the "email" feild ? i use the following code to send my mail.
Quote:
mail($toemail,$subject,"From: $name <$emailaddress>");
any ideas are welcome thanks (L]
Reply With Quote
  #2 (permalink)  
Old 09-30-2008, 01:26 PM
wige's Avatar
Moderator
WebProWorld Moderator
 

Join Date: Jun 2006
Location: United States
Posts: 1,843
wige RepRank 4wige RepRank 4wige RepRank 4wige RepRank 4
Default Re: Email Inbox Error

Assuming that the script is PHP, you are missing a field. The mail function arguments are as follows:

bool mail( $to, $subject, $body, $headers)

The bool that is returned is true if the e-mail was successfully passed on to the sendmail daemon. The to field is the e-mail address where the e-mail is to be sent, $subject and $body should be self-explanatory, and $headers is where you enter the various headers. Each header needs to be seperated with "\r\n". This is where you should be specifying the sender e-mail address.

nobody@yourserver.tld is the default user for your web server application. This automatically gets added as the return-path, since that is the user that originated the e-mail. However, if a From: is entered in the fourth parameter, it will override the return-path and that will not be visible unless the recipient manually views the headers.
__________________
The best way to learn anything, is to question everything.
Reply With Quote
  #3 (permalink)  
Old 09-30-2008, 01:35 PM
WebProWorld New Member
 

Join Date: Sep 2008
Posts: 18
ryanhouston RepRank 0
Default Re: Email Inbox Error

what does the $body part do to my script

Quote:
bool mail( $to, $subject, $body, $headers)
Reply With Quote
  #4 (permalink)  
Old 10-01-2008, 05:48 PM
chrisJumbo's Avatar
WebProWorld Pro
 

Join Date: Oct 2005
Location: California
Posts: 295
chrisJumbo RepRank 1
Default Re: Email Inbox Error

$body is the string that contains the body or text of your message.

For us we concatenate various items we are asking the visitor to complete:

ie,


$body = $body . "Phone: " . $_POST['phone'] . PHP_EOL;
$body = $body . "Term: " . $_POST['term'] . PHP_EOL;
$body = $body . "Inv: " . $_POST['investment'] . PHP_EOL;
$body = $body . "Hear: " . $_POST['hear'] . PHP_EOL;


Hope that helps.
__________________
CD Rates | CD Rates Blog | Banking Online
Reply With Quote
  #5 (permalink)  
Old 10-02-2008, 04:10 AM
WebProWorld New Member
 

Join Date: Sep 2008
Posts: 18
ryanhouston RepRank 0
Default Re: Email Inbox Error

yes i understand but i don't see how that will help my problem. look at the highlighted email in the image below i want the unkowen sender bit to say a value that they entered.

Reply With Quote
  #6 (permalink)  
Old 10-02-2008, 11:40 AM
chrisJumbo's Avatar
WebProWorld Pro
 

Join Date: Oct 2005
Location: California
Posts: 295
chrisJumbo RepRank 1
Default Re: Email Inbox Error

Whatever image you had posted didn't come through.

We have an email field on our form and add it to the $body.

$body = $body . PHP_EOL . $email;

When I get the contact email it has the details I noted above in my first reply plus the from email address.

If you want to see the form check it out from the links in the signature.

Send me a message, and I'll be happy to send you the code.

I do some processing on the text to try to catch various nefarious hacking attempts.

cd :O)
__________________
CD Rates | CD Rates Blog | Banking Online
Reply With Quote
  #7 (permalink)  
Old 10-02-2008, 12:07 PM
wige's Avatar
Moderator
WebProWorld Moderator
 

Join Date: Jun 2006
Location: United States
Posts: 1,843
wige RepRank 4wige RepRank 4wige RepRank 4wige RepRank 4
Default Re: Email Inbox Error

The e-mail address has to be put in the headers area, formatted as "From: a@b.c\r\n" so that it gets put into the headers. Otherwise it will simply be added to the end of the message.
__________________
The best way to learn anything, is to question everything.
Reply With Quote
  #8 (permalink)  
Old 10-14-2008, 02:15 PM
WebProWorld New Member
 

Join Date: Sep 2008
Posts: 18
ryanhouston RepRank 0
Default Re: Email Inbox Error

I Have Found My Problem No further Help Needed By Me In This Topic Thank Guys
Reply With Quote
Reply

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


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't access PM Inbox dharrison WebProWorld: Guidelines/Announcements/Suggestions 6 04-30-2007 05:03 PM
Maxed email inbox gelcreative IT Discussion Forum 4 12-28-2005 10:33 AM
Runtime Error - Line 1 - Error Syntex Error charms987 Graphics & Design Discussion Forum 6 07-29-2005 12:56 PM
Willing Link Partners Delivered To Your Inbox Phil Tanny Marketing Strategies Discussion Forum 2 01-15-2005 08:52 AM
To Moderator: Spam email in inbox Derald WebProWorld: Guidelines/Announcements/Suggestions 16 11-19-2003 09:52 AM


Search Engine Optimization by vBSEO 3.2.0