Closed JT3 closed 8 years ago
You need to call message.Prepare()
before calling Sign()
so that MIME parts get properly encoded. Either that or you need to specifically set the ContentTransferEncoding
of each part.
Since there's no way for MimeKit to know what encoding constraints the SMTP server will have, it has no idea what encoding to use unless you tell it.
To be safe (and allow it to work with all SMTP servers), you can call message.Prepare (EncodingConstraint.SevenBit);
I am not 100% sure if this is on the MimeKit side, or my IIS 7.5 SMTP server. Any guidance is appreciated.
I am using Mimekit to create messages in a c# console app and sending via mailkit. All initial testing was with short body messages, and it worked beautifully. Thanks. Moving to more complex messages with inline images caused the dkim signing to show as invalid, and narrowed it down to length as the contributing factor.
The following string set as the htmlbody with builder is successful. Taking the string up to 1000 characters causes the signing to fail validation at gmail, as does port 25's auth-results parser.
Is there a different way I need to handle the message when signing?
``port25.com response:
My code
` private static void sendDKIMmessage(todetail t, string _conn) { //http://www.mimekit.net/docs/html/CreatingMessages.htm MimeMessage m = new MimeMessage(); m.To.Add(new MailboxAddress(t.email, t.email));
`