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
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
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";
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