public void Execute(IJobExecutionContext context) { try { Thread tSendMails; tSendMails = new System.Threading.Thread(delegate() { //get list booking need alert email WareHouseJPDB db = new WareHouseJPDB(); foreach (var item in db.ExportGoods.Where(n => n.AirId == null)) { string html = "Body send email"; GMail.Send(item.Agency.Email, "[V/v] Yêu cầu booking " + DateTime.Now.ToString("dd.MM.yyyy"), html); } }); tSendMails.IsBackground = true; tSendMails.Priority = ThreadPriority.Highest; tSendMails.Start(); } catch { } }
public static void Send(String from, String to, String subject, String body) { GMail.Send(from, to, "", "", subject, body, ""); }
public static void Send(String to, String subject, String body) { String from = "BLF-JP <" + email + ">"; GMail.Send(from, to, "", "", subject, body, ""); }