I am trying to send an email with HTML markup and a picture that is generated by a PHP script. But the recipient receives a letter without a picture (instead of a picture, an empty space). My letter looks like this:
<p>Какой-нибудь текст...</p> <p>Картинка:</p> <p><img src="http://mysite.com/img.php"></p> <p>Какой-нибудь текст...</p> In img.php the following code:
$image = imagecreatetruecolor(50, 100); imagefill($image, 0, 0, 0x555555); header('Content-type: image/png'); imagepng($image); imagedestroy($image); If you open the link mysite.com/img.php , then the picture is displayed correctly. The letter itself contains the Content-Type: text/html . The recipient receives a letter, not even in spam, the text is displayed correctly, but instead of a picture, an empty space, and Firebug reports that the actual size of the picture is 1x1 px, although I specify a different size. Moreover, if I send a picture not from a php script, but simply from the server <img src="http://mysite.com/img1.png"> , then it is displayed at the recipient. But I need to send the generated image. Tell me what am I doing wrong?