Hi,
I'm trying to develop a send email function with .Net core Web API. Since .Net Core do not support SMTP yet, so I found a 3rd party plug in named MimeMessage to perform my task.
However, I get an System.NotSupportedException error "No data is available for encoding 10000" when I trying to running the code.
Following are my snippet code:
var emailMessage = new MimeMessage(); //System.NotSupportedException error occurred at here email = "destination@gmail.com"; subject = "Test send email"; message = "test message"; emailMessage.From.Add(new MailboxAddress("Send From", "SendFrom@gmail.com")); emailMessage.To.Add(new MailboxAddress("", email)); emailMessage.Subject = subject; emailMessage.Body = new TextPart("plain") { Text = message };
Please advise. Thanks.