Jump to content

[SOLVED] Headers in "mail" function


bass_sears

Recommended Posts

I've been strugling with this for a while and can't figure it out. I think there might be either DNS or server settings that are affecting my use of the PHP "mail" function.

 

Using these lines of PHP:

<?

$email = "[email protected]";

$fullmessage = "whatever";

$eol="\n";

$mime_boundary=md5(time());

$headers = "From: WRFRFFA <[email protected]>\n" .

"Return-Path: <[email protected]>\n" .

"Reply-To: <[email protected]>\n" .

"Content-Type: multipart/alternative; boundary=\"$mime_boundary\"\n";

mail($email, $subject, $fullmessage, $headers);

?>

 

... when my mail arrives in my Outlook, the "From" is "[email protected]", not "WRFRFFA" or "[email protected]" (HostMonster is who hosts my site that I'm running this PHP script on).

 

Both the "From" and "Return-path" in the headers are "[email protected]", not "[email protected]", although the Reply-To is "[email protected]".

 

Attached below are the headers from the email:

Return-path: <[email protected]>

Envelope-to: [email protected]

Delivery-date: Mon, 21 May 2007 22:52:54 -0600

Received: from localhost ([127.0.0.1] helo=host95.hostmonster.com)

by host95.hostmonster.com with esmtp (Exim 4.63)

(envelope-from <[email protected]>)

id 1HqMMg-0006rE-5P

for [email protected]; Mon, 21 May 2007 22:52:54 -0600

X-Originating-IP: [68.105.222.70]

Date: Mon, 21 May 2007 22:52:54 -0600

To: [email protected]

Subject: 9

From: [email protected]

Reply-To: <[email protected]>

Content-Type: multipart/alternative; boundary="2bf3c5c0482a725d6dcdea24cf3ab3f2"

X-Identified-User: {878:host95.hostmonster.com:wrfrffac:wrfrffa.com} {sentby:program running on server}

 

 

When I try sending to other users I get some weird stuff at the bottom of the headers, like:

X-Amavis-Alert: BAD HEADER MIME error: error: unexpected end of preamble

X-Spam-Status: No, hits=1.149 tagged_above=-999 required=3 tests=AWL,

BAYES_20, MIME_HEADER_CTYPE_ONLY, MSGID_FROM_MTA_ID, NO_REAL_NAME

X-Spam-Level: *

 

 

 

Anyone have any clue???? Am I just an idiot???

 

Thanks.

 

-- Bass

Link to comment
https://forums.phpfreaks.com/topic/52443-solved-headers-in-mail-function/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.