目前,当用户发送短信或提及他人时,会收到电子邮件。
邮件内容将占满整个邮件窗口。
那么如何设置电子邮件的最大宽度呢?例如 650px?
我尝试过这种方法,但没有成功!
您可以通过创建一个电子邮件模板来设置电子邮件的最大宽度,该模板将 %{email_content} 标签包裹在一个 max-width 通过 CSS 设置的表格中。如果您希望限制在 Outlook 中查看的电子邮件宽度,还需要添加一个具有固定宽度的表格,并将其包裹在 <!--[if mso]> 标签内。
以下是一个基本电子邮件模板,可将内容限制为最大 600px。如果您使用此模板,请务必将徽标图像 URL 替换为您网站徽标的 URL。同时,将 href 属性的值替换为您网站的 URL。徽标图像的 alt 属性应设置为对您网站有意义的文本。
:警告:由于模板包含网站徽标,因此您需要确保禁用“对摘要应用自定义样式”的网站设置。如果不这样做,从您的网站发送的摘要电子邮件顶部将显示两个徽标。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
</head>
<body style="margin: 0; padding: 0;">
<!--[if mso]>
<style type="text/css">
body, table, td, th, h1, h2, h3 {
font-family: Helvetica, Arial, sans-serif !important;
}
</style>
<![endif]-->
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td style="padding: 10px 0 30px 0;">
<!--[if gte mso 9]>
<table width="600" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><![endif]-->
<table align="center" border="0" cellpadding="0" cellspacing="0" width="100%"
style="max-width: 600px;border-collapse: collapse;">
<tr>
<td style="padding: 20px 15px 20px 15px;">
<table align="center" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="center">
<a href="https://forum.example.com">
<img src="https://your-site-logo-url"
alt="您的网站名称" width="150" height="40"
style="display: block;"/>
</a>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td style="padding: 0 15px 0 15px;">
<hr style="background-color: #ddd; height: 1px; border: 1px;">
</td>
</tr>
<tr>
<td style="padding: 20px 15px 30px 15px; color: #153643; font-family: Helvetica, Arial, sans-serif; font-size: 16px; line-height: 20px;">
%{email_content}
</td>
</tr>
</table>
<!--[if gte mso 9]></td></tr></table><![endif]-->
</td>
</tr>
</table>
我已使用电子邮件测试服务,针对大多数主流电子邮件客户端对此进行了测试:
iPad (Retina) (iOS 13.1):
Gmail 应用 (Android 6.0):
iPhone 6 Plus:
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.