简体   繁体   English

带样式标签的CDO.Message还是外部CSS?

[英]CDO.Message with style tag or external CSS?

Is it possible to use CSS via a style section or even an external CSS file from a VBScript using CDO.Message to send email? 是否可以通过样式部分使用CSS,甚至可以使用CDO.Message从VBScript使用外部CSS文件发送电子邮件?

Here is what I've tried: 这是我尝试过的:

Set objMessage = CreateObject("CDO.Message") 
...
objMessage.HtmlBody= "<style type='text/css'>headr {font-weight: bold;}</style>" & _
    "<table><tr class='headr'><td>test1</td><td>test2</td></tr>" &_
    ...

...
objMessage.Send

Which doesn't work. 这不起作用。 However, doing it inline does: 但是,以内联方式进行操作会:

objMessage.HtmlBody= "<table><tr style='font-weight:bold;'><td>test1</td><td>test2</td></tr>" &_

All messages will be delivered to Outlook. 所有邮件都将传递到Outlook。

It doesn't matter whether CDO or the Outlook object model is responsible for delivering emails. CDO或Outlook对象模型是否负责传递电子邮件都没有关系。 The viewer plays the key role there. 观看者在那里扮演关键角色。

As you may probably know Outlook uses Word for rendering HTML markup. 您可能知道Outlook使用Word呈现HTML标记。 The following articles describe supported and unsupported HTML elements, attributes, and cascading style sheets properties: 以下文章介绍了受支持和不受支持的HTML元素,属性以及级联样式表属性:

I forgot the . 我忘记了。 in my class definition. 在我的课堂定义中。

It works fine. 工作正常。

:| :|

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM