Im currently working with MailKit and Mimemessage in sending emails with “plain”,”html” and “rtf” bodies. Although I am having an issue with sending an email with an rtf body. As the email received, converts the rtf content into an attachment of an unknown type. Any suggestions as to how I can work around this? I have attached the code base im working with as well below.
`
<code>var message = new MimeMessage();
message.From.Add(new MailboxAddress("Joey", "[email protected]"));
message.To.Add(new MailboxAddress("Yash", "[email protected]"));
message.Subject = "How you doin?" + " - " + DateTime.Now.ToString();
string rtfBody = @"{rtf1ansideff0{colortbl;red0green0blue0;red255green0blue0;} This line is the default colorline cf2 This line is redline cf1 This line is the default color}";
// Create an RTF part with correctly formatted content type and charset
var rtfPart = new TextPart("rtf")
{
Text = rtfBody
};
message.Body = rtfPart;
SendMail(message); //this will just connect to the client and send the message
</code>
<code>var message = new MimeMessage();
message.From.Add(new MailboxAddress("Joey", "[email protected]"));
message.To.Add(new MailboxAddress("Yash", "[email protected]"));
message.Subject = "How you doin?" + " - " + DateTime.Now.ToString();
string rtfBody = @"{rtf1ansideff0{colortbl;red0green0blue0;red255green0blue0;} This line is the default colorline cf2 This line is redline cf1 This line is the default color}";
// Create an RTF part with correctly formatted content type and charset
var rtfPart = new TextPart("rtf")
{
Text = rtfBody
};
message.Body = rtfPart;
SendMail(message); //this will just connect to the client and send the message
</code>
var message = new MimeMessage();
message.From.Add(new MailboxAddress("Joey", "[email protected]"));
message.To.Add(new MailboxAddress("Yash", "[email protected]"));
message.Subject = "How you doin?" + " - " + DateTime.Now.ToString();
string rtfBody = @"{rtf1ansideff0{colortbl;red0green0blue0;red255green0blue0;} This line is the default colorline cf2 This line is redline cf1 This line is the default color}";
// Create an RTF part with correctly formatted content type and charset
var rtfPart = new TextPart("rtf")
{
Text = rtfBody
};
message.Body = rtfPart;
SendMail(message); //this will just connect to the client and send the message