C \ # 스 레 드 사용 시 전송

3876 단어 C#
        /// <summary>
/// , http
/// </summary>
/// <param name="toEmail"></param>
/// <param name="emailTitle"> </param>
/// <param name="emailBody"> </param>
/// <returns></returns>
public static string SendEmailByOA(string toEmail, string emailTitle, string emailBody)
{
//
string sendResult = string.Empty;

Thread thread = new Thread(() => SendEmail(toEmail, emailTitle, emailBody));
thread.Start();

return sendResult;
}

private static void SendEmail(string toEmail, string emailTitle, string emailBody)
{
string resultMessage = "";
try
{
string mailFrom = SendMail.MailHelper.MailServerFrom;
string mailTo = toEmail;
string mailCC = "";
string mailSubject = emailTitle;
string mailBody = emailBody;
string mailAttch = "";
SendMail.MailHelper.SendNetMail(mailFrom, mailTo, mailSubject, mailBody, mailAttch, "", mailCC, out resultMessage);
}
catch (Exception ex) { }
}

참고: http://www.cnblogs.com/lexiaoyao/archive/2011/12/01/2271120.html

좋은 웹페이지 즐겨찾기