Raju
Raju

Reputation: 207

DKIM using MIMEKIT

Im trying to DKIM sign all my emails using MIMEKIT and it works flawless for email body of smaller lenght but when content/size of email body increases., DKIM fails. Im generating the body using "BodyBuilder".

The following are my doubts in MIMEKIT

Is there any limitation in body/content length?. Is it Mandatory to give both text and html format of the content for DKIM sign?

Below is my code for reference:

var message = new MimeMessage();
message.From.Add(new MailboxAddress("Sender", "[email protected]"));
message.To.Add(new MailboxAddress("Mr K", ""[email protected]"));
message.Subject = "Hi";
message.Sender = new MailboxAddress("realsender", "[email protected]");
message.InReplyTo = "[email protected]";
var builder = new BodyBuilder();
builder.TextBody = strbodytxt;
builder.HtmlBody = strbody;
builder.Attachments.Add(strattachmentpath);
message.Body = builder.ToMessageBody();

Upvotes: 0

Views: 929

Answers (1)

jstedfast
jstedfast

Reputation: 38538

Is there any limitation in body/content length?

No.

Is it Mandatory to give both text and html format of the content for DKIM sign?

No.

Make sure you are using the latest version of MimeKit as there have been a number of bug fixes to DKIM signing.

If you are already using the latest version, please file a bug report with some sample code that fails.

Upvotes: 1

Related Questions