mail function

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
dethron
Forum Contributor
Posts: 370
Joined: Sat Apr 27, 2002 11:39 am
Location: Istanbul

mail function

Post by dethron »

Hi all;

I use following code in my web side


Code: Select all

$to_email = "tomail@mail.com";		
	$to_name = "Dear Sir";
	$from_name = "My Name";		
	$from_email = "mymail@mail.com";	
	$subject = $news_ex; // is a variable that has been posted
	$message = $news;	// is a variable that has been posted
	$to = ""$to_name" <$to_email>";
	$from = ""$from_name" <$from_email>";
	$to = str_replace("\''", "'", $to);
	$from = str_replace("\''", "'", $from);
	$subject = str_replace("\''", "'", $subject);
	$message = str_replace("\''", "'", $message);
	mail($to, $subject, $message, "From: $from\nX-Mailer: System33r");

However in this code, sent mails are added with an unwanted header.
Is there any way to send an email without any header?? Or only information that I provide.

Thanx all...
User avatar
dethron
Forum Contributor
Posts: 370
Joined: Sat Apr 27, 2002 11:39 am
Location: Istanbul

Post by dethron »

When I used

Code: Select all

mail($to, $subject, $message, "From: $from\n");
instead of

Code: Select all

mail($to, $subject, $message, "From: $from\nX-Mailer: System33r");

again, some header are added....
User avatar
mydimension
Moderator
Posts: 531
Joined: Tue Apr 23, 2002 6:00 pm
Location: Lowell, MA USA
Contact:

Post by mydimension »

some headers can't be avoided. can you post the headers that are being sent so we can what it is you are trying to remove?
User avatar
dethron
Forum Contributor
Posts: 370
Joined: Sat Apr 27, 2002 11:39 am
Location: Istanbul

X-AntiAbuse......is my problem....

Post by dethron »

When I used the second (without X-mailer...bla bla)
I get following unwanted part....

Code: Select all

Received: from &#1111;38.144.87.94] by hotmail.com (3.2) with ESMTP id MHotMailBEBD5BA700064004311B2690575EE16D0; Tue, 28 May 2002 16:20:08 -0700 
Received: from nobody by host06.ipowerweb.com with local (Exim 3.35 #1)id 17CqG7-0007Y2-00for mymail@hotmail.com; Tue, 28 May 2002 16:20:07 -0700 
From nobody@host06.ipowerweb.com Tue, 28 May 2002 16:20:29 -0700 
Message-Id: <E17CqG7-0007Y2-00@host06.ipowerweb.com> 
X-AntiAbuse: This header was added to track abuse, please include it with any abuse report 
X-AntiAbuse: Primary Hostname - host06.ipowerweb.com 
X-AntiAbuse: Original Domain - hotmail.com 
X-AntiAbuse: Originator/Caller UID/GID - &#1111;99 99] / &#1111;99 99] 
X-AntiAbuse: Sender Address Domain - host06.ipowerweb.com
Especially the part with "X-AntiAbuse......" are not needed by me.

Thanx all,
MattF
Forum Contributor
Posts: 225
Joined: Sun May 19, 2002 9:58 am
Location: Sussex, UK

Post by MattF »

Tough, it looks like the send mail thingy adds them by itself and there is no way around it, most people don't look at that much header information anyway.
User avatar
dethron
Forum Contributor
Posts: 370
Joined: Sat Apr 27, 2002 11:39 am
Location: Istanbul

Last five line

Post by dethron »

Yes you are right, most people do not interest in these headers. :)
However I wonder is there a way to remove the part with X:Abuse. :wink:

The only thing I get rid of is the last five lines. :twisted:

Thank you all. :oops:
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

Since it is added by the smtp-server, there is no way for you to get rid of it - would make no sense if.
As long as you are not spamming these lines shouldn't harm you
Post Reply