-
Email Question
Dear all,
I'm using the below mentioned code along with my emails....when i receive an email i see an attachment sign with it......and the mail isn't an attachment...
When i remove some of the part of it...then i don't see <HTML> emails.....
I want to send HTML emails....
Kindly let me know why is it so.....
Thanks
FmKing
####################################
$subject = "Subject";
$cl_mail_boundary = md5(uniqid(time()));
$mail_headers = "From:<[email protected]>\r\n";
$mail_headers .= "MIME-Version: 1.0\r\n";
$mail_headers .= "Content-type: multipart/mixed;boundary=\"$cl_mail_boundary\"";
$mail_headers .= "\r\n\r\n";
$mail_headers .= "This is a multi-part message in MIME format.";
$mail_headers .= "\r\n\r\n";
$message = "--$cl_mail_boundary\n";
$message .= "Content-type: text/html; charset=en\r\n";
$message .= "Content-transfer-encoding: 8bit\r\n\r\n";
$message .= "The message goes here";
####################################
-
for one you are missing half of your charset. and you don't add teh content-type in the message but you add it in the header.
another is that you don't need all that to send html email.
PHP Code:
$subject = "Subject";
$mail_headers = "From:<[email protected]>\r\n";
$mail_headers .= "Content-type: text/html\r\n";
$message = "The message goes here";
that is all you need.
-
Thanks a lot for replying and pointing out the mistakes.....
What else do i need to add in the charset........
And what exactly do i need to send a proper HTML email.
Thanks
FmKing
-
I already showed you.
PHP Code:
$subject = "Subject";
$mail_headers = "From:<[email protected]>\r\n";
$mail_headers .= "Content-type: text/html\r\n";
$message = "<html><head></head><body>";
$message .= "The message goes here";
$message .= "</body></html>";
-
Thanks a lot dear..
It worked out just fine..
-