Gmail wraps certain HTML elements in a class called im

后端 未结 9 2146
醉梦人生
醉梦人生 2021-02-02 05:38

I have been testing out an HTML e-mail process I\'ve created recently. But as of lately, when I open the e-mail in Gmail, I\'m noticing that certain elements are wrapped in a c

相关标签:
9条回答
  • 2021-02-02 05:59

    I had similar problems. I was sending emails from an application using templates. So, when I sent multiple emails to same address, lines that are exactly same in all of them got purple. Gmail added this tag automatically:

    <div class="im">
    .........
    </div>
    

    I do not know that for a fact, seemed to me Gmail wraps the common texts in a conversation with the this tag. Similar discussion here.

    0 讨论(0)
  • 2021-02-02 06:00

    I also experienced this problem when using a paragraph with single line breaks in it like this:

    <p>
       line 1<br>
       line 2<br>
       line 3
    </p>
    

    I was able to correct the problem from happening in Gmail from removing all the blank space from that specific part of HTML and bringing that entire paragraph and all it's contents back flush against the left edge of the screen. Sure it looks a little messy and you lose your proper indenting, but I think this helps Gmail not accidentally think you're quoting something inline.

    0 讨论(0)
  • 2021-02-02 06:01

    Gmail seems to think that you are quoting other emails in a conversation and so is wrapping div.im around the sections of your code that it thinks are previous bits in a conversation.

    This might happen if your code has a TABLE with more than one TR. To get around this, rather than several TRs in one TABLE, use several TABLEs with one TR in each.

    This might also happen if you have multiple subject lines that are the same, causing Gmail to think this is a conversation. You can fix this by making each subject line unique.

    0 讨论(0)
  • 2021-02-02 06:02

    Separate style files do not work for emails. What you can do though is add style for this class in the html as follows:

      <head>
           <style type="text/css">
            .im {
               color: #000000 !important;
            }
        </style>
      </head>
    

    This should give style to the class .im in case its found

    0 讨论(0)
  • 2021-02-02 06:02

    I have this issue too. And I just added a five-bit random char to every line end and set the color like the background. Then the issue got fixed.

    It's not a good way, but if no another way, maybe you can try it.

    0 讨论(0)
  • 2021-02-02 06:07

    You can use <br> tag in email html if it has style like: <br style="box-sizing:border-box">

    0 讨论(0)
提交回复
热议问题