string mail_to = "xxx";//逗號做區隔 string mail_subject = "xxx"; string mail_from = "xxx"; string smtpServer = "xxx"; string mail_body = "xxx"; System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage(); message.From = new System.Net.Mail.MailAddress(mail_from); message.To.Add(new System.Net.Mail.MailAddress(mail_to)); message.Subject = mail_subject; message.Body = mail_body; message.IsBodyHtml = true; System.Net.Mail.SmtpClient emailClient = new System.Net.Mail.SmtpClient(smtpServer); emailClient.Send(message);
沒有留言:
張貼留言