Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mail Header sent as body

Status
Not open for further replies.

namida

Programmer
May 29, 2003
101
AU
I have a mail code who sends a mail when a user signs up

Everything works fine, except that if I put any other header except From:
it goes into the body

This is my code for the headers


Code:
$From = "register@domain.com";
$Subject = "Welcome to ";
$headers .= "MIME-Version: 1.0\r\n"; 
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; 
$headers .= "From: $From\r\n"; 
$headers .= "Reply-To: $FROM\r\n"; 
$headers .= "X-Priority: 1\r\n"; 
$headers .= "X-MSMail-Priority: High\r\n"; 
$headers .= "X-Mailer: Just My Server\r\n"; 
$headers .= "Return-Path: $From\r\n";
$headers .= "Return-Receipt-To: $From\r\n";
and the usage of mail()

mail( $OwnnerMail,$Subject, $Body, $headers)

The result of the mail is

The headers is all included in the body so the person gets all the header before "Dear user," Not only does the header doesn't go to header it might freak out my users

Can someone point me out where I'm wrong here?


Oh, and can I use something like
if(!mail( $OwnnerMail,$Subject, $Body, $headers)){
echo "Attempt to send email to $OwnnerMail fails.";
}
??
I tried it but even with a false email address it doesn't print, neither does it bounces back to me.
That's why I'm trying to set up the headers up there.

Thanks in advance

 
namida,

There is an excellent mailer class out there that takes care of all mail issues you could ever have. I gladly use it to replace any custom mail function I've ever built:


It is worthwhile downloading and using. It will save you headaches.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top