Esempio n. 1
0
        public static bool SendMail(string emailFrom, string FromName, string emailTo, string emailCC, string emailBCC, string emailsubject, string emailbody, string[] val, string AttachFile)
        {
            bool result = false;

            try
            {
                FlexiMail objmail = new FlexiMail();
                objmail.From                 = emailFrom;
                objmail.To                   = emailTo;
                objmail.CC                   = emailCC;
                objmail.BCC                  = emailBCC;
                objmail.FromName             = FromName;
                objmail.Subject              = emailsubject;
                objmail.MailBodyManualSupply = true;
                objmail.AttachFile           = AttachFile;
                objmail.ValueArray           = val;

                objmail.MailBody = objmail.SetValues(emailbody);
                objmail.Send();
                result = true;
            }
            catch (Exception ex)
            {
                //result = false;
                //string inputdata = "false";
                //ErrorLogBusiness objerrorlog = new ErrorLogBusiness();
                //objerrorlog.InsertErrorLog("CustomerSignUpMail", inputdata, ex.Message);
                throw ex;
            }
            return(result);
        }
Esempio n. 2
0
        public static bool SendMailWithTemplate(string emailFrom, string FromName, string emailTo, string emailCC, string emailBCC, string emailsubject, string templateFileName, string[] val)
        {
            bool result = false;

            try
            {
                FlexiMail objmail = new FlexiMail();
                objmail.From                  = emailFrom;
                objmail.To                    = emailTo;
                objmail.CC                    = emailCC;
                objmail.BCC                   = emailBCC;
                objmail.FromName              = FromName;
                objmail.MailBodyManualSupply  = false;
                objmail.Subject               = emailsubject;;
                objmail.EmailTemplateFileName = HttpContext.Current.Server.MapPath("~/Template/" + templateFileName + "");
                objmail.ValueArray            = val;
                objmail.Send();
                result = true;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(result);
        }