System.Net.Mail.SmtpClient client = new System.Net.Mail.SmtpClient(smtpHost);
client.UseDefaultCredentials = true;
client.Credentials = new System.Net.NetworkCredential(account, pwd);
client.DeliveryMethod = System.Net.Mail.SmtpDeliveryMethod.PickupDirectoryFromIis;
System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage(from,to, subject, body);
message.BodyEncoding = System.Text.Encoding.UTF8;
message.IsBodyHtml = true;
client.Send(message);
全站熱搜
留言列表