我正在尝试通过下面的代码发送电子邮件,但服务点出现异常。我正在使用System.Net和System.Net.Mail;
objEmail.To.Add("client@mysite.com);
objEmail.Priority = MailPriority.Normal;
objEmail.IsBodyHtml = true;
objEmail.Subject = "test send e-mail";
objEmail.Body = "message...";
objEmail.SubjectEncoding = Encoding.GetEncoding("ISO-8859-1");
objEmail.BodyEncoding = Encoding.GetEncoding("ISO-8859-1");
SmtpClient objSmtp = new SmtpClient("mail.mysite.com")
{
Credentials = new NetworkCredential("awards@mysite.com", "myPassword"),
EnableSsl = true,
Port = 25
};
objSmtp.Send(objEmail);
我收到“引发了类型为System.NotSupportedException的异常”。