Click to See Complete Forum and Search --> : How to get an embedded background image in an email


Nap
04-17-2008, 05:47 AM
Hi guys,

I'm using XPM3 (XPM4 is available but I'm not using it) and I would like to insert an image that will be displayed as the background behind the text of the email. Does anyone know how to do this?

Cheers,
Nap

Nap
04-17-2008, 07:44 AM
I've done it.



$id = XPM3_MIME::unique();
$m->AttachFile('../images/IDFL_600x600_low_contrast.gif', '', '', '', 'base64', 'inline', $id);
$m->Html('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><body background="cid:'.$id.'">'.$message.'</body></html>');



First I attached the file, then I specified the html herder information with the background pointing to the CID of the image. The message text is appended afterwards. A bit messy but works.

Does anyone knows how to center the background image so it doesn't repeat itself?

Cheers,
Nap