0

我在 Pardot 中构建/拼凑了一封电子邮件。电子邮件工作正常,直到有人收到转发,然后整个标题部分消失;图像,背景颜色,文本和所有。

这是我的代码,有什么建议吗?我的 html/css 技能不太好,提前道歉。

<tr pardot-repeatable="Hero Banner Section" style="width: 650px;" width="650px">
                </tr>
                <tr>
                    <td class="pattern" width="650" align="center">
                    <table cellspacing="0" cellpadding="0">
                        <tbody>
                            <tr>
                                <td class="col" style="background-color: #f6f6f6;" width="325" valign="top" height="275">
                                <table cellspacing="0" cellpadding="0">
                                    <tbody>
                                        <tr>
                                            <td class="headline" pardot-region="pardot" style="font-family: Open Sans,sans-serif; font-size: 14px; font-weight: 800; color: #333; padding-top: 2rem; padding-left: 20px;" align="left">Join us in Tampa, FL</td>
                                        </tr>
                                        <tr>
                                            <td class="webinar_title" pardot-region="pardot" style="font-family: Open Sans,sans-serif; font-size: 24px; font-weight: 800; line-height: 2rem !important; color: #ea8c2a; padding-top: 10px; padding-right: 20px; padding-left: 20px;" align="left">2019 DATIS<br>
                                            Client Summit</td>
                                        </tr>
                                        <tr>
                                            <td class="time" pardot-region="pardot" style="font-family: Open Sans,sans-serif; font-size: 1rem; font-weight: 800; line-height: 1.5rem !important; color: #333333; padding-top: 10px; padding: 20px 20px 20px 20px" align="left">February 27 - March 1</td>
                                        </tr>
                                        <tr>
                                            <td style="text-align: center;">
                                            <div><a href="https://www.eventbrite.com/e/datis-client-summit-2019-tickets-49692846642" style="background-color:#ea8c2a;border:1px solid #ea8c2a;border-radius:4px;color:#ffffff;display:inline-block;font-family:sans-serif;font-size:13px;font-weight:bold;line-height:40px;text-align:center;text-decoration:none;width:200px; margin:20px;-webkit-text-size-adjust:none;">Register Now</a></div>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                                </td>
                                <td class="col" width="325px" valign="top">
                                <table cellspacing="0" cellpadding="0">
                                    <tbody>
                                        <tr>
                                            <td class="hero_image" style="background-color: #f6f6f6;"><img alt="" src="http://go.datis.com/l/106012/2018-10-05/4jdtys/106012/102359/SummitEMC_HeroRight_2.jpg" style="display: block; border: 0px;" width="325" height="275"></td>
                                        </tr>
                                    </tbody>
                                </table>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                    </td>
                </tr>
            </tbody>
        </table>
        </td>
    </tr>
4

1 回答 1

0

根据测试您的代码,您可以将代码更改为以下代码(我将 HTML 代码放在 .html 文件中):

<!DOCTYPE HTML>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title></title>

</head>
<body style="margin:0; padding:0; background-color:#FFFFFF;">

  <table width="640" cellspacing="0" cellpadding="0" border="0" align="center" style="max-width:640px; width:100%; background-position:right top !important; background-size:cover !important;"  bgcolor="#006554">
    <tbody>
      <tr pardot-repeatable="Hero Banner Section" style="width: 650px;" width="650px">
      </tr>
      <tr>
          <td class="pattern" width="650" align="center">
          <table cellspacing="0" cellpadding="0">
              <tbody>
                  <tr>
                      <td class="col" style="background-color: #f6f6f6;" width="325" valign="top" height="275">
                      <table cellspacing="0" cellpadding="0">
                          <tbody>
                              <tr>
                                  <td class="headline" pardot-region="pardot" style="font-family: Open Sans,sans-serif; font-size: 14px; font-weight: 800; color: #333; padding-top: 2rem; padding-left: 20px;" align="left">Join us in Tampa, FL</td>
                              </tr>
                              <tr>
                                  <td class="webinar_title" pardot-region="pardot" style="font-family: Open Sans,sans-serif; font-size: 24px; font-weight: 800; line-height: 2rem !important; color: #ea8c2a; padding-top: 10px; padding-right: 20px; padding-left: 20px;" align="left">2019 DATIS<br>
                                  Client Summit</td>
                              </tr>
                              <tr>
                                  <td class="time" pardot-region="pardot" style="font-family: Open Sans,sans-serif; font-size: 1rem; font-weight: 800; line-height: 1.5rem !important; color: #333333; padding-top: 10px; padding: 20px 20px 20px 20px" align="left">February 27 - March 1</td>
                              </tr>
                              <tr>
                                  <td style="text-align: center;">
                                  <div><a href="https://www.eventbrite.com/e/datis-client-summit-2019-tickets-49692846642" style="background-color:#ea8c2a;border:1px solid #ea8c2a;border-radius:4px;color:#ffffff;display:inline-block;font-family:sans-serif;font-size:13px;font-weight:bold;line-height:40px;text-align:center;text-decoration:none;width:200px; margin:20px;-webkit-text-size-adjust:none;">Register Now</a></div>
                                  </td>
                              </tr>
                          </tbody>
                      </table>
                      </td>
                      <td class="col" width="325px" valign="top">
                        <table cellspacing="0" cellpadding="0">
                            <tbody>
                                <tr>
                                    <td class="hero_image" style="background-color: #f6f6f6;"><img alt="" src="http://go.datis.com/l/106012/2018-10-05/4jdtys/106012/102359/SummitEMC_HeroRight_2.jpg" style="display: block; border: 0px;" width="325" height="275"></td>
                                </tr>
                            </tbody>
                        </table>
                      </td>
                  </tr>
              </tbody>
          </table>
          </td>
      </tr>
    </tbody>
  </table>
</body>
</html>

这是我的 c# 代码的一部分:

string stringHtmlBodyfromFile = File.ReadAllText(Your HTML File URL);
                Microsoft.Office.Interop.Outlook.MailItem mailItem = app.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olMailItem) as
                                                                     Microsoft.Office.Interop.Outlook.MailItem;
                mailItem.BodyFormat = Microsoft.Office.Interop.Outlook.OlBodyFormat.olFormatHTML;
                mailItem.Importance = Microsoft.Office.Interop.Outlook.OlImportance.olImportanceHigh;
                mailItem.Subject = subject;
                mailItem.To = email;
                mailItem.HTMLBody = stringHtmlBodyfromFile;
                mailItem.CC = cc;
               //mailItem.Display();

这是我的结果:

在此处输入图像描述

于 2018-10-09T08:03:49.807 回答