private void SendShareDocEmail(List <string> towho, string owner, string filename, string docid) { var routevalue = new RouteValueDictionary(); routevalue.Add("docid", docid); string scheme = Url.RequestContext.HttpContext.Request.Url.Scheme; string url = Url.Action("ReviewDocument", "FileShare", routevalue, scheme); var netcomputername = EmailUtility.RetrieveCurrentMachineName(); url = url.Replace("//localhost", "//" + netcomputername); var econtent = "Hi Guys,\r\n\r\n" + "You are shared file: " + filename + " by " + owner + ".\r\n\r\n" + "Click Below Link: " + url + "\r\n\r\n" + "Thanks\r\n\r\nEngineering System"; EmailUtility.SendEmail(this, "Document Share From Engineering System", towho, econtent); new System.Threading.ManualResetEvent(false).WaitOne(500); }
private void SendAnURLEmail(string what, string urlstr, List <string> towho) { try { var routevalue = new RouteValueDictionary(); string scheme = Url.RequestContext.HttpContext.Request.Url.Scheme; string validatestr = Url.Action("Welcome", "CoWork", routevalue, scheme); var netcomputername = EmailUtility.RetrieveCurrentMachineName(); validatestr = validatestr.Replace("//localhost", "//" + netcomputername); validatestr = validatestr.Split(new string[] { "/CoWork" }, StringSplitOptions.RemoveEmptyEntries)[0] + urlstr; var content = what + "<p>Topic Link: " + validatestr + "</p>"; var toaddrs = new List <string>(); toaddrs.AddRange(towho); EmailUtility.SendEmail(this, "WUXI Aurora System", toaddrs, content); new System.Threading.ManualResetEvent(false).WaitOne(20); } catch (Exception ex) { } }