Repeating inline images

Swift Mailer is a fantastic library for sending email with php. Discuss this library or ask any questions about it here.

Moderators: Chris Corbyn, General Moderators

Post Reply
majiga
Forum Newbie
Posts: 7
Joined: Mon Jun 11, 2007 9:42 am

Repeating inline images

Post by majiga »

Hi,

Is there any way to attach an inline image once but display it more than once? I'm finding that in some cases i need to use the same image twice in the one email but so far this means I have to attach it twice and thus the size of the email increases.

Is there an (easy?) way to attach it and then link to it as much as i need to? one of the things that was so great for me about swiftmailer was how easy it was to do inline images...


thanks heaps!
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: Repeating inline images

Post by Chris Corbyn »

majiga wrote:Hi,

Is there any way to attach an inline image once but display it more than once? I'm finding that in some cases i need to use the same image twice in the one email but so far this means I have to attach it twice and thus the size of the email increases.

Is there an (easy?) way to attach it and then link to it as much as i need to? one of the things that was so great for me about swiftmailer was how easy it was to do inline images...


thanks heaps!

Code: Select all

$img = $message->attach(new Swift_Message_Image( ... ));
$part = 'Here are two images <img src="' . $img . '" /> and <img src="' . $img . '" />';
Post Reply