I know it´s a duplicate post, I have been reading about a hundred of post about the issue, I also read every single issue about the module, but i can find a definitive answer. Some people said yes, some say not.
To come to the point.
I make a newsletter with simplenewsletter module, I test with mimemail alpha3, alpha4 and HEAD version and Mime Mail CSS Compressor. I use a couple of divs with a background images, I defined those properties in the mail.css. Sending the newsletter every seems ok but the background images defines by the property

background-image: url('myimages.png');

I try another possibilities ex.

background-image: url("myimages.png");
background-image: url("/sites/default/files/boletines/myimages.png");
background-image: url("sites/default/files/boletines/myimages.png");
even
background-image: url('http://mysites.com/sites/default/files/images/myimages.png');

But never attach the background images, and not load the images with the full url in gmail, even if i allow images from this site.
My question

IT´S AN EXPECTED BEHAVIOR, A WELL KNOW ISSUE SOLVED OR NOT, OR A MISCONFIGURATION OF MY SITE.
I hope anyone can help me to clarify mi mind

Thanks and excuse my english please

CommentFileSizeAuthor
#3 854354-mimemail-backgroupd-embed.patch645 bytesspheresh

Comments

sgabe’s picture

Status: Active » Closed (duplicate)

At the moment you can't attach CSS images to the message. However this can be done by using data URI schemes and there is a module called CSS Embedded Images which replaces image URLs in aggregated CSS files.

I have played around with this and I will update a patch as soon as I have time. You have to note that in this state of the module we have some major issues which we have to deal with first. This feature brings up some questions which need to be discussed in addition.

As you know, this is a duplicate of #108573: Embed CSS images so I am marking this as duplicate. Please followup there with any response.

smiletrl’s picture

Issue summary: View changes

Well, I have one dirty solution to this request.

The trick is to send you own css into mimemail template file via proprecess function.

Then, before adding css into preprocess function, replace the background image url with absolute image path, i.e, including your site url.

function MYMODULE_preprocess_mimemail_message(&$vars) {
    // Add own css into email.
    $css_path = drupal_get_path('module', 'mymodule') . '/css/mymodule.css';
    $css_content = @file_get_contents($css_path);


    // Replace css background-image path with site path.
    global $base_url;
    $image_path = $base_url . '/' . drupal_get_path('module', 'mymodule') . '/img/';

   // Build the absolute image path.
    $regular_path = $image_path . 'regular_arrow.png';

    // Replace the relative image path to absolute path.
    $css_content = str_replace('../img/regular_arrow.png', $regular_path, $css_content);

    // Add css into template. And we are done.
    $vars['css'] .= $css_content;
}

This works well for me. And may help some other guys..

spheresh’s picture

StatusFileSize
new645 bytes