BodyBuilder bodyBuilder = new BodyBuilder();
messageContent.Body = "<b>This is a test mail</b>";
bodyBuilder.HtmlBody = messageContent.Body;
I tried to embed my body to a bodybuilder but when I received the email, it returned an empty body. I have an exception that would throw an argument if the body is empty..
MimeKit Documentation - Creating Messages
"A TextPart is a leaf-node MIME part with a text media-type. The first argument to the TextPart constructor specifies the media-subtype: plain, html, enriched, rtf, and xml."
Using a
BodyBuilder
like you are doing is probably the easiest way.In some mail ISP, you should always set bodyBuilder.TextBody by value.
One other option here if you want to be strict;