0

我要发邮件,

<%
Set myMail=CreateObject("CDO.Message")
myMail.Subject="Sending email with CDO"
myMail.From="mymail@mydomain.com"
myMail.To="someone@somedomain.com"
myMail.CreateMHTMLBody "http://www.w3schools.com/asp/"
myMail.Send
set myMail=nothing
%>

然而,类似上面的东西,网页返回错误,

Microsoft VBScript 运行时错误“800a01b6”对象不支持

此属性或方法:'CreateMHTMLBody'

那么,我怎样才能发送带有 html 和图像的电子邮件,比如

<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" >
4

1 回答 1

0

在MSDN上查看这里。

' Reference to Microsoft ActiveX Data Objects 2.5 Library
' Reference to Microsoft CDO for Windows 2000 Library
Dim iMsg  as New CDO.Message
Dim iConf as New CDO.Configuration
Dim Flds  as ADODB.Fields
Set Flds = iConf.Fields
Flds(cdoURLProxyServer)      = "myserver:80"
Flds(cdoURLProxyBypass)      = "<local>"
Flds(cdoURLGetLatestVersion) = True
Flds.Update

With iMsg
   Set .Configuration = iConf
   ' IMPORTANT: Storing user names and passwords inside source code
   ' can lead to security vulnerabilities in your software. Do not
   ' store user names and passwords in your production code.
   .CreateMHTMLBody "http://InternalNTLMAuthRequiredServer", _
                    "domain\username", _
                    "password"
   .To      = "example2@example.com"
   .From    = "example@example.com"
   .Subject = "an example mhtml formatted message with attachment"
   .AddAttachment "http://server.example.com"
   .Send
End With

也看看这里: http: //www.paulsadowski.com/wsh/cdo.htm

我认为您使用该方法的方式是错误的。

干杯

于 2012-09-06T12:09:01.080 回答