Question: How do you parse an email with invalide characters in MailKit when using C#?
Login to See the Rest of the Answer
Answer: See the code below, see the other article here.
try
{
var mimeMessage = new MimeMessage();
mimeMessage.To.Add(InternetAddress.Parse(email));
mimeMessage.From.Add(new MailboxAddress(_emailSettings.Sender));
mimeMessage.Bcc.Add(InternetAddress.Parse("YourEmailAddress"));
mimeMessage.Subject = subject;
mimeMessage.Body = new TextPart("html")
{
Text = message
};
Jack said:
Thank you this was helpful!!