How you parse a collection of email addresses with mimekit?


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
                };

Technology
published
v.0.01



Jack said:

Thank you this was helpful!!

Posted On: June 02, 2020 17:40:37 PM

For peering opportunity Autonomouse System Number: AS401345 Custom Software Development at ErnesTech Email AddressContact: [email protected]