using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using WorkoPlus.DAL; using System.Data.SqlClient; using System.Net.Mail; /// /// Summary description for Helper /// /// public class Helper { private Helper() { // // TODO: Add constructor logic here // } public static bool SaveRequest(string filename,Boolean SaveHeaders) { bool bAns; try { HttpContext.Current.Request.SaveAs(filename, SaveHeaders); bAns = true; } catch (Exception ex) { throw ex; } return bAns; } public static void Mail(string sTo,string sName,string sFrom, string sMessage, string sSubject,string strAttachment) { SmtpClient smtpClient = new SmtpClient(); MailMessage message = new MailMessage(); try { MailAddress fromAddress = new MailAddress(sTo,sName); smtpClient.Host = "mail.workspecial.com"; smtpClient.Port = 25; message.From = fromAddress; message.To.Add(sTo); message.Subject = sSubject; message.IsBodyHtml = false; message.Body = sMessage ; if (string.IsNullOrEmpty(strAttachment) == false) { Attachment item = new Attachment(strAttachment); message.Attachments.Add(item); } smtpClient.Send(message); } catch (Exception ex) { } } }