我是新手到ASP.net我想通过一个文本框向多人发送邮件,每个电子邮件地址由,
分隔。现在我想发送邮件给多个人。我的代码是
public static void SendEmail(string txtTo, string txtSubject, string txtBody, string txtFrom)
{
try
{
MailMessage mailMsg = new MailMessage();
SmtpClient smtp = new SmtpClient("mail.valuesoft.org", 26);
smtp.Credentials = new NetworkCredential("mail@----.org", "@123");
mailMsg.From = new MailAddress(txtFrom);
mailMsg.To.Add(txtTo);
mailMsg.Subject = txtSubject;
mailMsg.Body = txtBody;
mailMsg.IsBodyHtml = true;
smtp.Send(mailMsg);
}
catch { }
}
答案 0 :(得分:0)
如果您要求如何解析逗号分隔列表:
print funWithNum[1](1, 2)