2012-05-23 58 views
0

使用類似下面的內容,是否可以爲DKIM簽名添加標頭?從我一直在讀的東西看,它看起來不像它。爲什麼不呢?如何將DKIM簽名添加到使用CDO發送的傳統ASP電子郵件

Dim iMsg, iConf, Flds 
Set iMsg = CreateObject("CDO.Message") 
Set iConf = CreateObject("CDO.Configuration") 

Set Flds = iConf.Fields 

Const cdoSendUsingPort = 2 

With Flds 
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort 
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "server" 
.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = 1 
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 
.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 'basic 
.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "abc" 
.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "123" 
.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10 
.Update 
End With 

With iMsg 
Set .Configuration = iConf 
.To = recipient 
.From = "[email protected]" 
.Subject = "subject" 
.HTMLBody = "body" 
.Send 
End With 

回答

0

如果您已經有了簽名,您可以將其添加到iMsg對象的Fields屬性中。我已經做了類似之前設置的東西「回覆」和「回執」地址:

.Fields("urn:schemas:mailheader:disposition-notification-to") = "[email protected]" 
.Fields("urn:schemas:mailheader:return-receipt-to") = "[email protected]" 

你可以做同樣添加任何自定義標題,你的情況DKIM簽名。您的iMsg對象變成:

With iMsg 
    Set .Configuration = iConf 
    .To = recipient 
    .From = "[email protected]" 
    .Subject = "subject" 
    .HTMLBody = "body" 
    .Fields("urn:schemas:mailheader:DKIM-Signature") = "YOUR_SIGNATURE_HERE" 
    .Send 
End With 

我希望有幫助。

相關問題