<?php$to="prab97@indiatimes.com";$from="help@indiatimes.com";$subject="Verify";$boundary="whatever";$headers="MIME-Version: 1.0\r\n";$headers.="Content-type: multipart/mixed;boundary=\"$boundary\"\r\n";$headers.="From: ".$from."\r\n";$headers.="Reply-To: ".$from."\r\n";$message = "--$boundary\n";$message.="Content-type: image/png\n";$message.="Content-Transfer-Encoding: base64\n";$message.="Content-disposition: inline\n\n";$encoded = base64_encode(file_get_contents("image.png"));$message.=$encoded."\n";$message.="--$boundary\n";$message.="Content-type: text/html; charset=\"iso-8859-1\"\n";$message.="Content-Transfer-Encoding: 7bit\n";$message.="Content-disposition: inline\n\n";$message.="This is a test. <a href="test.tst">Test</a>\n";$message.="--$boundary--";$send=mail($to, $subject, $message, $headers);if($send){echo "Mail was sent successfully!";}else {echo "Failed!!!";}?>
I tried multipart/mixed, multipart/alternative, multipart/related but can't succeed in making it display inline. I want the image to be displayed first, followed by html text. There's no clue I'm getting about where I went wrong. If you've any idea then do tell me.
2 comments:
I am having the same problem, did you find a solution? Can you help me?
My mail is sidneyrees@gmail.com
Thank you in advanse,
Sid
Not yet. Actually I didn't poke my head into it again.
Post a Comment