我正在使用VB ASP 3.0中的Web應用程序。我有以下代碼發送電子郵件:給電子郵件添加額外的頭文件VB ASP 3.0腳本
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 = "[email protected]"
fFromAlias = "Display name"
fReplyTo = "[email protected]"
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"
,但沒有奏效。任何幫助將不勝感激。
這工作!謝謝。 – user2217231