[SOLVED] inline images
Posted: Wed Feb 28, 2007 8:51 am
Hi, I've been using Swift for last 2 months to control e-mail traffic on my website and I'd like to do some e-mail info action. In order to do this I'd like to sent some messages with an image inline just the way spammers do. Here's the snippet of code I'm using (it's Swift version 2, I don't have time to migrate to version 3 now)
As you can guess, my email template contains part
Thanks in advance
phobos
Code: Select all
$email = $this->emailContent; // get the template
// some manipulation with content - insert name, current date and then
$mailer = new Swift(new Swift_Connection_SMTP($address));
$cid = $mailer->addImage($this->config['image_file']);
$email = mb_eregi_replace('image_name', $cid, $email);
if ($mailer->authenticate($user, $pass) {
$mailer->send($toAddress, $address, 'test', $email);
}
else echo 'mailer failed to connect';
$mailer->close();And the problem is that my image isn't even attached to e-mail at all! Should I do anything more? I thought that simple addImage method will be OK.<img src="image_name" style="some_style_over_here"/>
Thanks in advance
phobos