User not logged in - login - register
Home Calendar Books School Tool Photo Gallery Message Boards Users Statistics Advertise Site Info
go to bottom | |
 Message Boards » » Message-Id: in body of emails via php:mail() Page [1]  
rynop
All American
829 Posts
user info
edit post

I've moved to a new webhost and seeing some strange behavior. When i call php's mail() function to send some mail, i see a 'Message-Id:' followed by a 'Date:' in the body of the mail message. I'm using gmail to read it. The from email address is a noreply@mydomain.com. The body looks like this:

Message-Id: <20080121054007.17BF1890E@mydomain.com>
Date: Mon, 21 Jan 2008 00:40:07 -0500 (EST)

Why is this happening, and how can i remove it??
thx

1/21/2008 12:47:50 AM

Talage
All American
5093 Posts
user info
edit post

Are you using a free host? Seems shitty, but maybe your host set up their mail server to add that automatically. Probably as a way to deter people from using their mail servers to send fraudulent type spam stuff.

1/21/2008 1:15:38 AM

rynop
All American
829 Posts
user info
edit post

nope not free server. Its a vps so im setting everything up. Im using ubuntu server. I installed postfix, changed my hostname (/etc/hostname) changed my php.ini with the sendmail string (I dont have access to box right now otherwise id include the string i used). I then restarted postfix.

any ideas?

1/21/2008 12:02:35 PM

jbtilley
All American
12797 Posts
user info
edit post

Huh. I recently had a problem appear where the mailTo string read:

email1@domain1.com, email2@domain2.com, etc., etc.

In the past it always worked, then all of a sudden it started including the space as part of the e-mail address. So the above line translated to:


email1@domain1.com
%20email2@domain2.com
%20etc.
%20etc.


Easy to remedy, just delete the space from the code that generates the mailTo string. Still odd though. I have this elsewhere and it looks like it only adds the space if the string is dumped in the bcc line.

1/21/2008 12:16:41 PM

mellocj
All American
1872 Posts
user info
edit post

Can you paste all of the headers?

1/21/2008 12:23:11 PM

Stein
All American
19842 Posts
user info
edit post

Are you setting a From: header?

1/21/2008 12:25:35 PM

rynop
All American
829 Posts
user info
edit post

Yes I'm setting a from header. I'll paste my mail() call and the message it generates when i get home tonight.

1/21/2008 12:35:38 PM

rynop
All American
829 Posts
user info
edit post

php.ini:
sendmail_path = /usr/sbin/sendmail -i -t

$headers = 'From: no-reply@sharednotebook.com' . "\r\n";
mail($to, $subject, $message, $headers);

resulting email:

from no-reply@sharednotebook.com
to myemail@my.com
date Jan 21, 2008 4:44 PM
subject my subject

Message-Id: <20080121224438.0CE81890E@sharednotebook.com>
Date: Mon, 21 Jan 2008 17:44:37 -0500 (EST)

rest of body

1/21/2008 5:50:32 PM

DirtyMonkey
All American
4269 Posts
user info
edit post

^ i have the same sendmail path (except that the switches are reversed). i had just sent myself a test email from my web server a few days ago, so i looked it up and saw that it did NOT have the Message-Id in the body, but it WAS in the "original" view in the header. here is an excerpt from that email, with private info removed of course.

Quote :
"
To: me@myemail.com
Subject: Email from website
From: mailer@testwebsite.com
Reply-to: mailer@testwebsite.com
Cc:
Message-Id: <20080116180020.96815364084@myserver.com>
Date: Wed, 16 Jan 2008 13:00:20 -0500 (EST)

(body follows here)
"


[Edited on January 21, 2008 at 6:26 PM. Reason : .]

1/21/2008 6:26:16 PM

rynop
All American
829 Posts
user info
edit post

I figured it out. I had an extra "\r\n" at the end.

1/21/2008 6:39:11 PM

 Message Boards » Tech Talk » Message-Id: in body of emails via php:mail() Page [1]  
go to top | |
Admin Options : move topic | lock topic

© 2024 by The Wolf Web - All Rights Reserved.
The material located at this site is not endorsed, sponsored or provided by or on behalf of North Carolina State University.
Powered by CrazyWeb v2.39 - our disclaimer.