I'm trying to add an imagejpeg result as an attachment of an email.
For creating the email I'm using phpmailer class
(http://phpmailer.sourceforge.net/)
Now I do create an image from a jpeg file for adding some text on it and
then send it to somebody:
here is the code:
$image = "/include/images/model.jpg";
$src = imagecreatefrom jpeg($image);
$size = getimagesize($i mage);
$dst = imagecreatetrue color($size[0],$size[1]);
$txt_color = ImageColorAlloc ate ($dst, 0, 0, 0);
ImageString ($dst, 5, 90, 30 ,"my name", $txt_color);
$tempimage = imagejpeg($dst) ;
if (!$mail->AddstringAttac hment($tempimag e,"model.jpg" ))
echo ("<strong>failu re attachment file</strong><br>");
Instead of attachment file, I get the failure attachment file message on the
screen after a lot of text (the jpeg file in text format).
What do I wrong ?