PHP mail() function

Status
Not open for further replies.

GordyMac

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

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:

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?
 
Code:
From: $EMAIL
Reply-To: $EMAIL

Let me see where $from is assigned, and how you are using the header.
 
I made a mistake, it should be

From: $from
Reply-To: $from

and

$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..

$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

mail($to,$subject,$message,$headers);
 
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.
 
No difference.. like I said, everyhting but the return-path works.. like its being over written or over ruled by the root admin..
 
Seems weird.. I believe you can.. and besides, if you can't.. why would they have that as a header option?
 
Status
Not open for further replies.
Back
Top Bottom