图像边框在Outlook 2010/2007中不起作用

时间:2013-02-19 22:27:43

标签: image outlook border

问题在于:我希望图片上有白色边框,但是当我将它发送到我的Outlook 2007或2010时,它没有显示。以下是相关图片的代码:

<img src="my.jpg" alt="" width="220" height="220" border="3" style="border:3px solid #FFF;" />

这个问题有解决方法吗?我觉得我已经尝试了一切,没有任何效果。

这确实渲染了边框,但它不是理想的解决方案,因为图像和边框之间有空格。

<table width="220" height="220" border="0" cellspacing="0" cellpadding="0" style="border:3px solid #FFF;">
    <tr>
        <td>
            <img src="my.jpg" alt="" width="220" height="220" border="0" title="70's Styled House and Pool" />
        </td>
    </tr>
</table>

3 个答案:

答案 0 :(得分:3)

我认为你必须将它包装成某种东西。 Span怎么样:

s = "<html><body>" _
& "<span style='display:inline-block;padding:5px;border:5px solid #fff;'>" _
& "<img src='z:\docs\image1.jpg' alt='' width=220 height=220></span>" _
& "</body></html> "

Set oEmail = Application.CreateItem(olMailItem)

oEmail.HTMLBody = s
oEmail.Display

答案 1 :(得分:1)

我无法使用SPAN解决方案(我怀疑是因为我的CMS添加了额外的代码)。

我的解决方案是将图像包装在一个表格中,其中cellpadding设置为所需的边框宽度,bgcolor设置为所需的边框颜色。几乎没有语义,但这是Outlook的错。

答案 2 :(得分:-1)

您的一个问题是电子邮件中不支持十六色短手。所以你应该使用所有六个十六进制数字。

<img
    src="http://example.com/image.jpg" 
    alt="" 
    width="220" 
    height="220" 
    border="3"
    style="border:3px solid #ffffff;" />