ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Sending HTML Email

January 21, 2008 7:18pm

Subscribe [11]
  • #1 / Jan 21, 2008 7:18pm

    ggoforth

    119 posts

    Hello All,

    I’m trying to send HTML email which is working just fine, however I’m having some issues with the HTML styling.  At first I was using remote style sheets, which I assumed should work fine, but after looking at the HTML code igniter is sending, it’s looks very odd, which lots of extra chars. added that I didn’t put there.  Example of this below:

    <link rel=3D"stylesheet” type=3D"text/css” media=3D’print’ href=3D"http://=
    http://www.myurl.com/mycss.css” />

    Notice the random “3D” chars. that are showing up for some reason.  The above example comes from the echo $this->email->print_debugger(); CI function.  Any reason why this would be happening?  Can you remotely link to CSS files for HTML email?

    Thanks for any input anyone can offer!

    Greg

  • #2 / Jan 21, 2008 8:24pm

    Derek Jones's avatar

    Derek Jones

    7561 posts

    That’s quoted-printable encoding. = is the quoted-printable escape character and 3D is the encoding for an equal sign, so the MUA will interpret =3D as simply =.  In general, most MUAs are very random in what CSS they will and won’t display, and most only do well with inline styles.  Here’s a quick guide from Campaign Monitor.

  • #3 / Jan 21, 2008 8:29pm

    ggoforth

    119 posts

    Thanks so much Derek. I was hoping to re-use my code I had for my printable reports, but I can probably whip something up with inline styles.  For what it’s worth, I’m testing this with Gmail, and haven’t used Outlook or any other email programs.  I’ll check out your link.  Thanks!

    Greg

  • #4 / Jan 21, 2008 10:35pm

    ejangi's avatar

    ejangi

    220 posts

    If you can I would recommend testing in Outlook 2007 first, as it’s the most picky of the bunch (believe it or not, it uses the Word 2007 rendering engine). You should find that what works in Outllook will work elsewhere, with a few minor updates to get it working in Gmail etc…

  • #5 / Jan 21, 2008 10:40pm

    ggoforth

    119 posts

    That’s quoted-printable encoding. = is the quoted-printable escape character and 3D is the encoding for an equal sign, so the MUA will interpret =3D as simply =.  In general, most MUAs are very random in what CSS they will and won’t display, and most only do well with inline styles.  Here’s a quick guide from Campaign Monitor.

    That is a great article.  Thanks to everyone for the replys.

    Greg

  • #6 / Jan 22, 2008 10:01am

    Chris Newton's avatar

    Chris Newton

    440 posts

    As someone that codes email (partly) for a living I’ll tell you this: I use basic inline styles for minor things, colors, fonts, basic padding. For actual layout… it’s ALL tables. Lame I know, but I can’t tell you how many email apps screw stuff up if you position with CSS.

    And ucantblamem is right. Outlook 2007 is like stepping back in time to 1998. Outlook 2000 renders CSS better.

  • #7 / Jan 22, 2008 11:49am

    Edemilson Lima's avatar

    Edemilson Lima

    241 posts

    The only thing I don’t saw in CI Email class is a method to embed images into the HTML Email. In my old web sites I was using PHP Mailer (http://phpmailer.sourceforge.net) and it have this feature.

    The only way to put images into HTML Emails is pointing images at your server (using full URLs), but webmails and Email clients will not display these images automatically. If you embed them into the Email, they will appear normally, without user intervention.

  • #8 / Feb 05, 2008 11:18am

    frenzal's avatar

    frenzal

    136 posts

    Even most embedded iamges get blocked these days too.

  • #9 / Feb 05, 2008 4:45pm

    Chris Newton's avatar

    Chris Newton

    440 posts

    Worse, the email gets sent to the spam folder of many of the major vendors. Deliverability is very low on email with HTML + embedded images. Much lower than email with linked images.

  • #10 / Feb 05, 2008 6:02pm

    Edemilson Lima's avatar

    Edemilson Lima

    241 posts

    I don’t think so. I made my tests and it works fine on most web mails out there. The problem with Emails that have linked images is the fact that a spammer can use it to validate Emails in their lists. When somebody opens a spam message and the image is loaded from an URL, it send an ID to a script in a web server somewhere. This does not happen with embed images, because they are sent with the Email as attachments, so I think embed images are less probable to be blocked than linked images. At least, that is the logic. Ok, the message is larger than a message with only linked images, but I think the problem of to be blocked by some anti-spam is because the message does not come from a know Email client or web mail, may it doesn’t have all necessary headers (like Return-path, for example), doesn’t have a valid Email address or the server doesn’t have a MX record. There are many things that can block a message, but if it is the case, the addressee can mark it as not spam. But I agree that is preferable to send messages as plain text. They are lighter and is more likely to be accepted everywhere.

  • #11 / Feb 09, 2008 5:15pm

    Chris Newton's avatar

    Chris Newton

    440 posts

    You may have logic on your side, but I have white papers, deliverability reports, and experience that prove otherwise… at least when averaged across the email industry as a whole. Agreed, in limited testing, one or another provider may fall to either side, but across the great gamut of web & application based email, I know where the line lies. I work regularly with whitelisting & black listing agencies at a variety of companies like AOL, Verizon, Yahoo, etc. and can tell you, embedded images increase the risk of automatic blockage when sending bulk email (anything over 100 at a time.) As you say, there are many factors that ultimately inform the spam issue, but embedded images is not an industry best-practice, and is more suited when sending image based signatures, or personal email. YMMV, so I’ll leave it at that.

  • #12 / Feb 09, 2008 10:04pm

    Edemilson Lima's avatar

    Edemilson Lima

    241 posts

    and can tell you, embedded images increase the risk of automatic blockage when sending bulk email (anything over 100 at a time.)[/code]

    Well, after many extensive tests and statistics reports, if you are saying so, I believe. But I think the embed images can be used for the Emails that an user of a web site receive when he/she finish the register, ask for a password, is notified of a new post or things like that, because each Email have a different contents, so the anti-spam will not threat them as the same thing, repeated hundred times. Unless, maybe, the web site have thousands of simultaneous users everyday. But in any case where we need to send more than one hundred similar messages, like a direct mail, is better to deliver plain text messages to save bandwidth too.

    embedded images is not an industry best-practice, and is more suited when sending image based signatures, or personal email

    I agree that is better to send messages with linked images, as this will save bandwidth and mailbox space.

  • #13 / Oct 13, 2010 2:07pm

    codepotato's avatar

    codepotato

    8 posts

    The way i got this to work was to do the following in the controller / model that you’re using to process the email.

    $config = array();
    $config['mailtype'] = 'html';
    $this->load->library('email', $config);

    This clears any defaults set by codeigniter, and just sends using plain html. Works a treat for me!

  • #14 / Nov 01, 2010 8:18pm

    aidehua

    59 posts

    I’ve been pulling my hair out over =3D and =20 and all sorts of unwelcome equals signs that show up in HTML emails in Outlook (breaking links, image srcs, table layouts, line breaks, everything).

    This was all while testing on localhost / Windows 7 XAMPP.

    Emails looked fine in Gmail / webmail. But not in Outlook or Windows Live Mail.

    Tried 108 million things to fix it, read the whole internet looking for a solution. No luck. Still broken in Outlook & Windows Live Mail.

    Uploaded everything to live server.

    Works fine.

    Not really sure what the logic is there. But it works.

  • #15 / Nov 14, 2010 8:36pm

    novice32

    57 posts

    When I set send_multipart to false, “3D” still appears but the link works. When true, it didn’t work. Try (i.e.

    $config_email['send_multipart'] = FALSE;

    ) Multipart is not in CI User Guide, but read up on it in libraries\Email.php

    I struggled with this for a while.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases