コード例 #1
0
        public bool SendEmail(string msgID)
        {
            EmailBLL eBLL = new EmailBLL();

            eBLL.BuildAndSendEmail(msgID, AttachFolder);
            return(true);
        }
コード例 #2
0
        /// <summary>
        /// Date Created: 27/03/2012
        /// Created By:   Gabriel Oquialda
        /// (description) Load e-mail address
        /// </summary>
        protected void LoadEmailAddress(string BranchId)
        {
            IDataReader dr = null;

            try
            {
                dr = EmailBLL.LoadEmailAddress(BranchId);

                if (dr.Read())
                {
                    uoTextBoxTo.Text = dr["colEmailToVarchar"].ToString();
                    uoTextBoxCc.Text = dr["colEmailCcVarchar"].ToString();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (dr != null)
                {
                    dr.Close();
                    dr.Dispose();
                }
            }
        }
コード例 #3
0
        /// <summary>
        /// Author:         Josephine Gad
        /// Date Created:   04/Mar/2013
        /// Description:    Email Notification when the system resumes
        /// </summary>
        protected void uoButtonResume_Click(object sender, EventArgs e)
        {
            List <ActiveUserEmail> list = new List <ActiveUserEmail>();

            list = EmailBLL.GetActiveUserEmail();

            List <ActiveUserEmail> listEmailed = new List <ActiveUserEmail>();
            ActiveUserEmail        item;

            if (list.Count > 0)
            {
                for (int i = 0; i < list.Count; i++)
                {
                    if (SendEmail_Resume(list[i].sEmail))
                    {
                        item        = new ActiveUserEmail();
                        item.sEmail = list[i].sEmail;
                        listEmailed.Add(item);
                    }
                }
                if (listEmailed.Count > 0)
                {
                    ListView1.DataSource = null;
                    ListView1.DataBind();

                    uoUserList.DataSource = listEmailed;
                    uoUserList.DataBind();
                }
            }
        }
コード例 #4
0
 public SignUpController()
 {
     _user            = new UserBll();
     _moduleBll       = new ModuleBLL();
     _organizationBll = new OrganizationBLL();
     _emailBll        = new EmailBLL();
     _templateBll     = new TemplateBLL();
 }
コード例 #5
0
 /// <summary>
 /// Date Created: 28/03/2012
 /// Created By:   Gabriel Oquialda
 /// (description) Save e-mail address
 /// </summary>
 private void SaveEmailAddress(string bId, string EmailTo, string EmailCc)
 {
     try
     {
         EmailBLL.SaveEmailAddress(bId, EmailTo, EmailCc);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #6
0
        public void Execute(IJobExecutionContext context)
        {
            //Verifica no web.config se esta ativo para enviar o job
            var appSettings = ConfigurationManager.AppSettings;
            var ativarJob   = appSettings["AtivarJobs"].ToBoolean();

            if (ativarJob)
            {
                //Enviar Email
                EmailBLL emailBLL = new EmailBLL();
                emailBLL.EnviarEmailTeste();
            }
        }
コード例 #7
0
 //send mail with link for rest password
 protected void SendMeilRestPassword(string sendto, string username, string id, string UserID)
 {
     if (EmailBLL.IsValidEmailAddress(sendto))
     {
         StringBuilder Emailbody = new StringBuilder();
         Emailbody.Append("http://*****:*****@"C:\Users\isaya\OneDrive\שולחן העבודה\c#\GargeManger\EmailTamplate\RestPasswordAdmin.html";
         StreamReader sr          = new StreamReader(path);
         string       FullMessage = sr.ReadToEnd();
         FullMessage = FullMessage.Replace("{Url}", Emailbody.ToString());
         sr.Close();
         EmailBLL.SendMailMessage(sendto, "*****@*****.**", null, null, "איפוס סיסמא", FullMessage, null);
     }
 }
コード例 #8
0
        // send user mail with new code
        public void sendemail()

        {
            if (EmailBLL.IsValidEmailAddress(Request.QueryString["tb_email"]))
            {
                StringBuilder Emailbody = new StringBuilder();
                Emailbody.Append("http://*****:*****@"C:\Users\isaya\OneDrive\שולחן העבודה\c#\GargeManger\EmailTamplate\EmailVerifcationAgain.html";
                StreamReader sr          = new StreamReader(path);
                string       FullMessage = sr.ReadToEnd();
                FullMessage = FullMessage.Replace("{activatoncode}", activatoncode);
                FullMessage = FullMessage.Replace("{Url}", Emailbody.ToString());
                sr.Close();
                EmailBLL.SendMailMessage(Request.QueryString["tb_email"], "*****@*****.**", null, null, "VerificationAgain", FullMessage, null);
            }
        }
コード例 #9
0
        public ActionResult Excluir(ContatosModel model)
        {
            var strcnn = System.Configuration.ConfigurationManager.AppSettings["connectionString"].ToString();

            if (model.TIP == 1)
            {
                EmailBLL email = new EmailBLL(strcnn);
                email.Excluir(model.ID, out int retval);
            }
            else if (model.TIP == 2)
            {
                TelefoneBLL telefone = new TelefoneBLL(strcnn);
                telefone.Excluir(model.ID, out int retval);
            }
            return(RedirectToAction("Lista"));
        }
コード例 #10
0
ファイル: MailConfigFrm.cs プロジェクト: shakasi/coding
        private void MailConfigFrm_Load(object sender, EventArgs e)
        {
            //添加俩个smpt服务器的名称
            cmbBoxSMTP.Items.Add(EmailProtocolInfo.Smtp163);
            cmbBoxSMTP.Items.Add(EmailProtocolInfo.SmtpGmail);
            cmbBoxSMTP.Items.Add(EmailProtocolInfo.SmtpQQ);
            //设置为下拉列表
            cmbBoxSMTP.DropDownStyle = ComboBoxStyle.DropDownList;
            //默认选中第一个选项
            cmbBoxSMTP.SelectedIndex = 0;

            _emailBLL  = new EmailBLL();
            _emailInfo = _emailBLL.GetEntityFromXml();
            InitUI();
            _log.Info("邮件MailConfigFrm_Load");
        }
コード例 #11
0
 public void sendemail()
 {
     if (EmailBLL.IsValidEmailAddress(tb_email.Text))
     {
         StringBuilder Emailbody = new StringBuilder();
         Emailbody.Append("http://*****:*****@"C:\Users\isaya\OneDrive\שולחן העבודה\c#\GargeManger\EmailTamplate\EmeilVerifyAccount.html";
         StreamReader sr          = new StreamReader(path);
         string       FullMessage = sr.ReadToEnd();
         FullMessage = FullMessage.Replace("{UserName}", tb_Fname.Text);
         FullMessage = FullMessage.Replace("{NameGarage}", tb_namebisance.Text);
         FullMessage = FullMessage.Replace("{activatoncode}", activatoncode);
         FullMessage = FullMessage.Replace("{Url}", Emailbody.ToString());
         sr.Close();
         EmailBLL.SendMailMessage(tb_email.Text, "*****@*****.**", null, null, "Verification", FullMessage, null);
     }
 }
コード例 #12
0
 protected void bt_send_Click(object sender, EventArgs e)
 {
     try
     {
         if (EmailBLL.IsValidEmailAddress(tb_email.Text))
         {
             EmailBLL.SendMailMessage("*****@*****.**", tb_email.Text, null, null, tb_subjact.Text, tb_message.Text, null);
             lbl_message.Text = "השליחה בוצעה בהצלחה!";
             tb_name.Text     = "";
             tb_email.Text    = "";
             tb_message.Text  = "";
             tb_subjact.Text  = "";
         }
     }
     catch (Exception ex)
     {
         lbl_message.Text = ex.Message;
     }
 }
コード例 #13
0
        protected void Button2_Click(object sender, EventArgs e)
        {
            try
            {
                EmailBLL emailBLL = new EmailBLL();
                emailBLL.UpdateDB(TextBox1.Text, TextBox2.Text, TextBox3.Text, DropDownList1.SelectedItem.Text, TextBox4.Text);



                var    fromAddress  = new MailAddress("*****@*****.**", "From Admin");
                var    toAddress    = new MailAddress("*****@*****.**", "To SmartTrainPortal");
                string fromPassword = Encrypt.Decrypt("+kQYEpjlGzE+xkT/7aal5Q==");
                string subject      = DropDownList1.SelectedItem.Text;
                string body         = "Sender name : " + TextBox1.Text + Environment.NewLine
                                      + "Sender email : " + TextBox2.Text + Environment.NewLine
                                      + "Sender reason : " + TextBox4.Text + Environment.NewLine;

                var smtp = new SmtpClient
                {
                    Host                  = "smtp.gmail.com",
                    Port                  = 587,
                    EnableSsl             = true,
                    DeliveryMethod        = SmtpDeliveryMethod.Network,
                    UseDefaultCredentials = false,
                    Credentials           = new NetworkCredential(fromAddress.Address, fromPassword)
                };
                using (var message = new MailMessage(fromAddress, toAddress)
                {
                    Subject = subject,
                    Body = body
                })
                {
                    smtp.Send(message);
                    Response.Write("<script>window.alert('Thank you for contacting us, We will get back to you soon.')</script>");
                }
            }
            catch (Exception ex)
            {
                Response.Write("<script>window.alert('There is a problem. Please try again later')</script>");
            }
        }
コード例 #14
0
ファイル: EWController.cs プロジェクト: coinci/CHubMVC
        public ActionResult SendSample(string id)
        {
            try
            {
                string toAddr  = string.Empty;
                string appUser = Session[CHubConstValues.SessionUser].ToString();

                if (IsTooOften(id, appUser))
                {
                    return(Json(new RequestResult(false, "Too Frequent,Need 10 minites interval")));
                }

                APP_USERS_BLL userBLL = new APP_USERS_BLL();
                APP_USERS     user    = userBLL.GetAppUserByDomainName(appUser);
                if (user == null)
                {
                    return(Json(new RequestResult(false, "Can't find User:"******"RunJobs", ex);
                return(Json(new RequestResult(false, ex.Message)));
            }
        }
        public void Execute(IJobExecutionContext context)
        {
            if (semaforo.EstaProcesando == false)
            {
                semaforo.EstaProcesando = true;

                try
                {
                    DescargaAutomaticaActualizacionBLL descargaAutomaticaActualizacionBll = new DescargaAutomaticaActualizacionBLL();
                    EmailBLL emailBll = new EmailBLL();
                    Task     tarea1   = new Task(() => descargaAutomaticaActualizacionBll.ExtraerInformacionPaginaSoporte());
                    Task     tarea2   = new Task(() => emailBll.EnvioArchivoActualizacionSoftware());
                    tarea1.Start();
                    tarea2.Start();
                    Task.WaitAll(tarea1);
                }
                catch (Exception e)
                {
                    Logger log = LogManager.GetLogger("Error");
                    log.Error(e.Message.ToString());

                    EmailBLL managerEmail = new EmailBLL();
                    managerEmail.EnviarMailAdmin("ERROR: " + e.Message.ToString(), "Envío notificación Descarga Automatica CEPET");
                }
                finally
                {
                    if (semaforo.EstaProcesando == true)
                    {
                        Semaforo.setInstance("EnvioNotificacionDescargaAutomaticaActualizacion");
                        if (semaforo.CantidadArchivosConError > 0)
                        {
                            Semaforo.setInstance("EnvioNotificacionDescargaAutomaticaActualizacion");
                        }
                    }
                }
            }
        }
コード例 #16
0
        protected void SendEmailByAdmin()
        {
            Garge  garge   = new Garge(Convert.ToInt32(Session["UserID"]));
            string Name    = garge.GetNameGarga();
            String Address = garge.GetAddress();
            String City    = garge.get_city();
            String phone   = garge.GetPhone();

            if (EmailBLL.IsValidEmailAddress(tbEmail.Text))
            {
                string       path        = @"C:\Users\isaya\OneDrive\שולחן העבודה\c#\GargeManger\EmailTamplate\NewCustomerAdd.html";
                StreamReader sr          = new StreamReader(path);
                string       FullMessage = sr.ReadToEnd();
                FullMessage = FullMessage.Replace("{UserName}", Fname.Text);
                FullMessage = FullMessage.Replace("{LastName}", Lname.Text);
                FullMessage = FullMessage.Replace("{NameGarga}", Name);
                FullMessage = FullMessage.Replace("{UserIdCard}", tbUser.Text);
                FullMessage = FullMessage.Replace(" {Address}", Address);
                FullMessage = FullMessage.Replace("{City}", City);
                FullMessage = FullMessage.Replace("{phone}", phone);
                sr.Close();
                EmailBLL.SendMailMessage(tbEmail.Text, "*****@*****.**", null, null, "לקוח יקר", FullMessage, null);
            }
        }
コード例 #17
0
    protected void btnOK_Click(object sender, EventArgs e)
    {
        string backupFlag; //backup保存返回的插入信息
        string emailFlag;  //backup保存返回的插入信息

        System.Guid KeyIdGuid;

        this.EncapsulationData();

        if (this.TempKeyId == string.Empty)//插入
        {
            //插入Backup数据
            BLL_Backup = new BackupBLL();
            backupFlag = BLL_Backup.Insert(BackupObj);
            if (!backupFlag.Equals("InsertError"))
            {
                //将数据保存到客户端cookie
                HttpCookie myCookie = new HttpCookie("BuckupSetting");

                myCookie.Values.Add("BackupId", backupFlag);
                myCookie.Expires = System.DateTime.Now.AddDays(1);
                Response.AppendCookie(myCookie);
            }
            else
            {
                //错误提示信息
                MessageBox(false, false, true,
                           GetGlobalResourceObject("WebResource", "BackupSettingForm_SaveBackupMessage_ErrorMessage").ToString());
            }

            //插入Email数据
            BLL_Email = new EmailBLL();
            emailFlag = BLL_Email.Insert(EmailObj);
            if (!emailFlag.Equals("InsertError"))
            {
                //将数据保存到客户端cookie
                HttpCookie myCookie = new HttpCookie("EmailSetting");

                myCookie.Values.Add("EmailId", emailFlag);
                myCookie.Expires = System.DateTime.Now.AddDays(1);
                Response.AppendCookie(myCookie);
            }
            else
            {
                //错误提示信息
                MessageBox(false, false, true,
                           GetGlobalResourceObject("WebResource", "EmailSettingForm_SaveEmailSetting_ErrorMessage").ToString());
            }

            if (!emailFlag.Equals("InsertError") && !backupFlag.Equals("InsertError"))
            {//backup和Email的保存都成功
                Job_Email = new Email();
                Job_Email.CreateEmail(emailFlag);
                Response.Redirect("~/Schedule Billing/ScheduleTasksForm.aspx");
            }
        }
        else//编辑
        {
            KeyIdGuid  = new Guid(this.TempKeyId);//转换成Guid类型
            BLL_Backup = new BackupBLL();

            BackupObj.BackupID = KeyIdGuid;
            backupFlag         = BLL_Backup.Update(BackupObj);//更新错误,则进行数据插入
            if (!backupFlag.Equals("InsertError"))
            {
                //将数据保存到客户端cookie
                HttpCookie myCookie = new HttpCookie("BuckupSetting");

                myCookie.Values.Add("BackupId", this.TempKeyId);
                myCookie.Expires = System.DateTime.Now.AddDays(1);
                Response.AppendCookie(myCookie);
            }
            else
            {
                //错误提示信息
                MessageBox(false, false, true,
                           GetGlobalResourceObject("WebResource", "BackupSettingForm_UpdateBackupMessage_ErrorMessage").ToString());
            }

            BLL_Email        = new EmailBLL();
            EmailObj.EmailID = KeyIdGuid;
            emailFlag        = BLL_Email.Update(EmailObj);
            if (!emailFlag.Equals("InsertError"))
            {
                //将数据保存到客户端cookie
                HttpCookie myCookie = new HttpCookie("EmailSetting");

                myCookie.Values.Add("EmailId", this.TempKeyId);
                myCookie.Expires = System.DateTime.Now.AddDays(1);
                Response.AppendCookie(myCookie);
            }
            else
            {
                //错误提示信息
                MessageBox(false, false, true,
                           GetGlobalResourceObject("WebResource", "EmailSettingForm_UpdateEmailSetting_ErrorMessage").ToString());
            }

            if (!emailFlag.Equals("InsertError") && !backupFlag.Equals("InsertError"))
            {//backup和Email的保存都成功
                Job_Email = new Email();
                Job_Email.CreateEmail(KeyIdGuid.ToString());
                Response.Redirect("~/Schedule Billing/ScheduleTasksForm.aspx");
            }
        }
    }
コード例 #18
0
 public void POSTsengEmail([FromBody] Email email)
 {
     EmailBLL.sendEmail(email);
 }