SignDKIM method should be called right *BEFORE* the actual
SendMessage call, or the signature will be invalid.
In order to successfully sign a message, you will need to provide
your private key as Certificate parameter. Please
remember to specify only the text value, and not the surrounding
"-----BEGIN RSA PRIVATE KEY-----" and "-----END RSA PRIVATE
KEY-----" lines. Also, make sure that you wrap the key value into a
single line, thus removing the end of line characters.
You also need a domain name with public key published in it's
"TXT" record. If you don't have one, please check
here for
instructions on how to create one. Typically, DKIM domain will look
like "example._domainkey.yourdomain.com". This value is then
provided as a second parameter, but without the "_domainkey"
part. In this example, the KeyDomain parameter would
be set to "test.yourdomain.com".
In order to verify that the DKIM domain is created, you can do a
simple nslookup from command prompt. I.e:
nslookup
set q=TXT
example._domainkey.yourdomain.com
The above sequence of
commands should return a line similar to this:
v=DKIM1;t=s;n=core;p=your_public_key_here
The Headers parameter required are names of the
headers that will be included into the signature. You can specify
any header here, but make sure that ":" separator is used in
between. I.e: Headers parameter can be set to
"From:To:Subject:Date".
More information on DKIM can be found
here.