Back to product page

SignDKIM Method


Adds DKIM signature to the message.

Syntax

  • Basic
object.SignDKIM (Certificate, KeyDomain, Headers)
The SignDKIM(object,Certificate,KeyDomain,Headers) syntax has these parts:
objectAn expression evaluating to an object of type SmtpMsg
CertificateRequired. A String value. Private key used to sign the message.
KeyDomainRequired. A String value. Name of DKIM selector and belonging domain (without "_domainkey" part)
HeadersRequired. A String value. Represents headers which will be used to sign a message.

Remarks

SignDKIM method is used to attach a *token* to your message. The added token is used to tell the recipient who is responsible for the e-mail. This is particularly useful if sender changed their From address, or mail server IP address. In such cases, the recipient can tell that the e-mail is coming from the same person and/or organization previous e-mails were received from.

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.

Platforms

Windows