Please Login to Continue

Free Software Development Articles.Email List

Advertise Here

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

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
Buy Me Coffee

Was this page helpful?

Yes Yes! this solution to the problem was helpful. No No! this solution to the problem was not helpful..



© 2020 - ErnesTech - Privacy