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 = "bass@wrfrffa.com";

$fullmessage = "whatever";

$eol="\n";

$mime_boundary=md5(time());

$headers = "From: WRFRFFA <newsletter@wrfrffa.com>\n" .

"Return-Path: <newsletter@wrfrffa.com>\n" .

"Reply-To: <newsletter@wrfrffa.com>\n" .

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

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

?>

 

... when my mail arrives in my Outlook, the "From" is "wrfrffac@host95.hostmonster.com", not "WRFRFFA" or "newsletter@wrfrffa.com" (HostMonster is who hosts my site that I'm running this PHP script on).

 

Both the "From" and "Return-path" in the headers are "wrfrffac@host95.hostmonster.com", not "newsletter@wrfrffa.com", although the Reply-To is "newsletter@wrfrffa.com".

 

Attached below are the headers from the email:

Return-path: <wrfrffac@host95.hostmonster.com>

Envelope-to: bass@wrfrffa.com

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 <wrfrffac@host95.hostmonster.com>)

id 1HqMMg-0006rE-5P

for bass@wrfrffa.com; 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: bass@wrfrffa.com

Subject: 9

From: wrfrffac@host95.hostmonster.com

Reply-To: <newsletter@wrfrffa.com>

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.