使用类似下面的内容,是否可以为DKIM签名添加标题?从我读过的东西来看,它看起来不像..为什么不呢?
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 = "foo@bar.com"
.Subject = "subject"
.HTMLBody = "body"
.Send
End With
答案 0 :(得分:0)
如果您已拥有签名,则可以将其添加到iMsg
对象的Fields属性中。我之前做过类似的事情来设置“回复”和“回执”地址:
.Fields("urn:schemas:mailheader:disposition-notification-to") = "test@example.com"
.Fields("urn:schemas:mailheader:return-receipt-to") = "test@example.com"
您可以这样做以添加任何自定义标头,在您的情况下是DKIM签名。您的iMsg
对象变为:
With iMsg
Set .Configuration = iConf
.To = recipient
.From = "foo@bar.com"
.Subject = "subject"
.HTMLBody = "body"
.Fields("urn:schemas:mailheader:DKIM-Signature") = "YOUR_SIGNATURE_HERE"
.Send
End With
我希望有所帮助。