Home > Articles > Details

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#?


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

If you log in, you will be notified when someone leaves a comment.

Other users would like to know if this solution helped you.

Jack said:

Thank you this was helpful!!

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

© 2022 - ErnesTech - Privacy