I am writing an email attachment script in PHP. I have successfully done the image attachment to email but I am facing issues with the html.
Two Important thing in the Email:
Email Content which is HTML with some designs.
Email Attach Images.
If i use the following header I am able to see the Email with HTML designed. But attachment not working.
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=UTF-8\r\n";
If i use the following header I can able to attach the images successful. but the html is just coming as it is not showing how it was designed...
// boundary
$semi_rand = md5(time());
$mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";
// headers for attachment
$headers .= "\nMIME-Version: 1.0\n" . "Content-Type: multipart/mixed;\n" . " boundary=\"{$mime_boundary}\"";
// multipart boundary
$message = "This is a multi-part message in MIME format.\n\n" . "--{$mime_boundary}\n" . "Content-Type: text/plain; charset=\"iso-8859-1\"\n" . "Content-Transfer-Encoding: 7bit\n\n" . $message . "\n\n";
Also this email should be shown perfectly in Outlook:
Can some one help to solve the issue.