我正在使用 VB ASP 3.0 中的 Web 应用程序。我有以下代码来发送电子邮件:
Const cdoSendUsingMethod = _
"http://schemas.microsoft.com/cdo/configuration/sendusing"
Const cdoSendUsingPort = 2
Const cdoSMTPServer = _
"http://schemas.microsoft.com/cdo/configuration/smtpserver"
Const cdoSMTPServerPort = _
"http://schemas.microsoft.com/cdo/configuration/smtpserverport"
Const cdoSMTPConnectionTimeout = _
"http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout"
Const cdoSMTPAuthenticate = _
"http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"
Const cdoBasic = 1
Const cdoSendUserName = _
"http://schemas.microsoft.com/cdo/configuration/sendusername"
Const cdoSendPassword = _
"http://schemas.microsoft.com/cdo/configuration/sendpassword"
Set objMessage = CreateObject("CDO.Message")
objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing")=2
objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate")=1
objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername")="xxxxxxx"
objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword")="xxxxxxx"
objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl")=false
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver")="smtp.socketlabs.com"
objMessage.Configuration.Fields.Update
fFromEmail = "xxx@xxx.com"
fFromAlias = "Display name"
fReplyTo = "xxx@xxx.com"
if isObject(objMessage) then
With objMessage
.To = fToEmail
.Cc = fCCEmail
.Bcc = fBCCEmail
.From = fFromAlias & "<" & fFromEmail & ">"
.Subject = fSubject
.HTMLBody = fEmailBody
.Send
End With
SendEmail = summaryEmailBody
Set objMessage = Nothing
End If
该脚本有效,但现在我需要添加一个额外的标题。但是当不在 .net 框架中时,我找不到如何做到这一点。
我尝试添加以下行:
objMessage.Configuration.Fields.Item("urn:schemas:mailheader:X-xsMailingId") = "clientName"
但它没有用。任何帮助将不胜感激。