Hello all!
I tried to send my email header as an inline image, so customers may not need to download the image seperately. This works for a lot of newsletters and looks far more professional to me.
I know that the image must be attached to the email by a base64-enconding and a cid no. I created a little function in php to send my logo-file via email in this mime-coding and received that well.
In my search to include this file with its encoding to zen-carts email functions I found that in class.phpmailer.php there is already such a function to base64-encode an attachment.
How do I use this?
I tried to put in my values like this:
PHP Code:
function AddEmbeddedImage($path="email/", $cid, $name = "rr-h1.gif", $encoding = "base64",
$type = "image/gif") {
if(!@is_file($path))
{
$this->SetError($this->Lang("file_access") . $path);
return false;
}
$filename = basename($path);
if($name == "")
$name = $filename;
// Append to $attachment array
$cur = count($this->attachment);
$this->attachment[$cur][0] = $path;
$this->attachment[$cur][1] = $filename;
$this->attachment[$cur][2] = $name;
$this->attachment[$cur][3] = $encoding;
$this->attachment[$cur][4] = $type;
$this->attachment[$cur][5] = false; // isStringAttachment
$this->attachment[$cur][6] = "inline";
$this->attachment[$cur][7] = $cid;
return true;
}
But my image doesn't come in my inbox...
Does anybody use this and knows a HowTo?
Bookmarks