Page 1 of 1

HTMLmail: Embedding images with id

Posted: Sat Mar 07, 2009 5:21 am
by uyuni
Is this a bug or am I doing something wrong?

According to the manual I can use:

Code: Select all

$src = $message->attach($swift_image, $id);
The second parameter should be:
# string $id: An identifier to use (one is returned otherwise)

But the returnvalue always has a newly generated id, not the one I gave as 2nd parameter!

I'd like to define the id myself so I can use a template for the HTML with the image-src already in the template.

Emilio

Re: HTMLmail: Embedding images with id

Posted: Sat Mar 07, 2009 5:40 am
by uyuni
I already found how to do it.
The id has to be entered in the Swift_Message_Image class:

Code: Select all

$swift_img =& new Swift_Message_Image(new Swift_File($path), $filename, "application/octet-stream", $id);