Using something like the below, is it possible to add a header for a DKIM signature? From what I've been reading, it doesn't look like it.. Why not?
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
If you already have the signature, you could add it to the Fields property of your
iMsg
object. I've done something similar before to set the "Reply To" and "Return Receipts" addresses:You could do the same to add any custom header, in your case the DKIM signature. Your
iMsg
object becomes:I hope that helps.