Sign Email
This feature allows you to sign an email message using DKIM. The `sign` function takes the email content and options including the domain name, key selector, and private key, and returns the signed email.
const dkim = require('dkim-signer');
const email = 'From: sender@example.com\r\nTo: receiver@example.com\r\nSubject: Test\r\n\r\nThis is a test email.';
const options = {
domainName: 'example.com',
keySelector: 'default',
privateKey: '-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASC...\n-----END PRIVATE KEY-----'
};
const signedEmail = dkim.sign(email, options);
console.log(signedEmail);