Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Closed Thread
Old 02-03-2009, 12:03 PM   #1 (permalink)
 
Junior Techie

Join Date: Jan 2004

Posts: 56

GordyMac is on a distinguished road

Send a message via ICQ to GordyMac Send a message via AIM to GordyMac Send a message via Yahoo to GordyMac
Default PHP mail() function

I am using the PHP mail() function to send emails, I have identified the following headers:

Quote:
From: $from\r\nReply-To: $from\r\nReturn-Path: $from\r\n
$from is being identified as an email address.

now when I look at the headers in the email after I receive it, it says:

Quote:
Return-path: <nobody@SERVERNAME>
Envelope-to: contact@SITE
Delivery-date: Tue, 03 Feb 2009 11:58:40 -0500
Received: from nobody by SERVERNAME with local (Exim 4.69)
(envelope-from <nobody@SERVERNAME>)
id 1LUObg-0007rX-PV
for contact@SITE; Tue, 03 Feb 2009 11:58:40 -0500
To: contact@SITE
Subject: SITE
From: $EMAIL
Reply-To: $EMAIL
Message-Id:< *************>
Date: Tue, 03 Feb 2009 11:58:40 -0500
Why is it showing as nobody@SERVERNAME in the headers once it has been received?
GordyMac is offline  
Old 02-03-2009, 07:39 PM   #2 (permalink)
CrazeD's Avatar
 
Wizard Techie

Join Date: Feb 2006

Location: Maine

Posts: 3,683

CrazeD will become famous soon enough

Send a message via AIM to CrazeD Send a message via MSN to CrazeD
Default Re: PHP mail() function

Code:
From: $EMAIL
Reply-To: $EMAIL
Let me see where $from is assigned, and how you are using the header.
__________________

Need website help? PM me!
CrazeD is offline  
Old 02-03-2009, 08:02 PM   #3 (permalink)
 
Junior Techie

Join Date: Jan 2004

Posts: 56

GordyMac is on a distinguished road

Send a message via ICQ to GordyMac Send a message via AIM to GordyMac Send a message via Yahoo to GordyMac
Default Re: PHP mail() function

I made a mistake, it should be

Quote:
From: $from
Reply-To: $from
and

Quote:
$to = "$telephone$provider";
$from = $_POST['email'];
$message = $_POST['message'];
$subject = "txtme.co.cc";
Which is set obviously in a form, but it does work because it displays it perfect in the other 2 fields but not the Return-Path..

Quote:
$headers = "From: $from\r\n";
$headers .= "Reply-To: $from\r\n"; // Return path for errors
$headers .= "Return-Path: $from\r\n"; // Return path for errors
and finally the actual sending

Quote:
mail($to,$subject,$message,$headers);

GordyMac is offline  
Old 02-03-2009, 09:11 PM   #4 (permalink)
CrazeD's Avatar
 
Wizard Techie

Join Date: Feb 2006

Location: Maine

Posts: 3,683

CrazeD will become famous soon enough

Send a message via AIM to CrazeD Send a message via MSN to CrazeD
Default Re: PHP mail() function

Code:
$headers = "From: ".$from."\r\n";
$headers .= "Reply-To: ".$from."\r\n"; // Return path for errors
$headers .= "Return-Path: ".$from."\r\n"; // Return path for errors
Try that.
__________________

Need website help? PM me!
CrazeD is offline  
Old 02-03-2009, 09:59 PM   #5 (permalink)
 
Junior Techie

Join Date: Jan 2004

Posts: 56

GordyMac is on a distinguished road

Send a message via ICQ to GordyMac Send a message via AIM to GordyMac Send a message via Yahoo to GordyMac
Default Re: PHP mail() function

No difference.. like I said, everyhting but the return-path works.. like its being over written or over ruled by the root admin..
GordyMac is offline  
Old 02-03-2009, 10:24 PM   #6 (permalink)
CrazeD's Avatar
 
Wizard Techie

Join Date: Feb 2006

Location: Maine

Posts: 3,683

CrazeD will become famous soon enough

Send a message via AIM to CrazeD Send a message via MSN to CrazeD
Default Re: PHP mail() function

I did some Googleing and it seems you cannot change the Return-Path.
__________________

Need website help? PM me!
CrazeD is offline  
Old 02-03-2009, 10:43 PM   #7 (permalink)
 
Junior Techie

Join Date: Jan 2004

Posts: 56

GordyMac is on a distinguished road

Send a message via ICQ to GordyMac Send a message via AIM to GordyMac Send a message via Yahoo to GordyMac
Default Re: PHP mail() function

Seems weird.. I believe you can.. and besides, if you can't.. why would they have that as a header option?
GordyMac is offline  
Old 02-03-2009, 11:34 PM   #8 (permalink)
CrazeD's Avatar
 
Wizard Techie

Join Date: Feb 2006

Location: Maine

Posts: 3,683

CrazeD will become famous soon enough

Send a message via AIM to CrazeD Send a message via MSN to CrazeD
Default Re: PHP mail() function

php change return-path - Google Search

Go nuts. You can't change it with just assigning the header like that.
__________________

Need website help? PM me!
CrazeD is offline  
Old 02-04-2009, 10:33 AM   #9 (permalink)
 
Junior Techie

Join Date: Jan 2004

Posts: 56

GordyMac is on a distinguished road

Send a message via ICQ to GordyMac Send a message via AIM to GordyMac Send a message via Yahoo to GordyMac
Default Re: PHP mail() function

CrazeD, the first result from your google link, that works.. thanks!
GordyMac is offline  
Old 02-07-2009, 07:39 PM   #10 (permalink)
Dr.House's Avatar
 
True Techie

Join Date: Dec 2008

Location: Rx Counter

Posts: 147

Dr.House is on a distinguished road

Send a message via AIM to Dr.House
Default Re: PHP mail() function

Quote:
Originally Posted by GordyMac View Post
CrazeD, the first result from your google link, that works.. thanks!
Google is your friend :-) especially with programming questions
__________________
Dr. House
--------------------------------------------------

Antec 900, P5K SE, E8400 "Wolfdale" 4.06GHz, Tuniq Tower, 4Gb GSkill DDR2 891, WD Caviar SE16 250, Radeon 4670 HD, WD Raptor WD1500ADFD (for sale, ~$900)
Thinkpad T61 CTO 2.2 Ghz Core 2 Duo, 2 gig, 100 gig 7200 RPM, 15.4" wide screen (for sale ~$800)
MacBook Pro C2D 2.2GHz 4 gig, 100 gig 7200 RPM
PowerBook G4 Aluminum
Dr.House is offline  
 
Closed Thread

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

BB 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
Wev Development: How does PHP work? Osiris Programming Discussions 1 01-08-2009 04:31 PM
Returned mail to User who didnt send mail philb101 Virus - Spyware Protection / Detection 1 04-15-2008 10:58 AM
Yahoo! Mail announces unlimited email storage maroon1 News & Polls 4 05-30-2007 11:03 PM