It is necessary to send a message with the image: Display the illustration in the letter and hang the html map on it.
Function to send:
function SendMyMail($to,$from,$subject,$message,$boundary,$filename){ $headers = "From: $from\nReply-To: $from\n"; $headers .= "Content-Type: multipart/mixed; boundary=\"$boundary\""; $body = "--" . $boundary . "\n"; $body .= "Content-type: text/html; charset='utf-8'\n"; $body .= "Content-Transfer-Encoding: quoted-printablenn"; $body .= "Content-Disposition: attachment; filename==?utf-8?B?".base64_encode($filename)."?=\n\n"; $body .= $message."\n"; $body .= "--$boundary\n"; $file = fopen($filename, "r"); //ΠΡΠΊΡΡΠ²Π°Π΅ΠΌ ΡΠ°ΠΉΠ» $text = fread($file, filesize($filename)); //Π‘ΡΠΈΡΡΠ²Π°Π΅ΠΌ Π²Π΅ΡΡ ΡΠ°ΠΉΠ» fclose($file); //ΠΠ°ΠΊΡΡΠ²Π°Π΅ΠΌ ΡΠ°ΠΉΠ» $body .= "Content-Type: application/octet-stream; name==?utf-8?B?".base64_encode($filename)."?=\n"; $body .= "Content-Transfer-Encoding: base64\n"; $body .= "Content-Disposition: attachment; filename==?utf-8?B?".base64_encode($filename)."?=\n\n"; $body .= chunk_split(base64_encode($text))."\n"; $body .= "--".$boundary ."--\n"; mail($to, $subject, $body, $headers); //ΠΡΠΏΡΠ°Π²Π»ΡΠ΅ΠΌ ΠΏΠΈΡΡΠΌΠΎ }
html letters:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META content="text/html; charset=UTF-8" http-equiv=Content-Type> <MAP name=FPMap0> <AREA href="site.com/" shape="rect" coords="112, 73, 668, 132"> </MAP> <BODY> <P align=center> <IMG border=0 src="ΡΡΠ΄Π° Π½Π°Π΄ΠΎ Π²ΡΡΠ°Π²ΠΈΡΡ ΠΊΠ°ΡΡΠΈΠ½ΠΊΡ" width=800 height=1964 useMap=#FPMap0> </P> </BODY> </HTML>
How can I refer to the image in img
?
I tried to simply substitute the path to the picture on the Internet, but Outlook does not display it.