예제 #1
0
        //The place I changed for email generation
        protected int SendEmail(string To, string Subject, string Body)
        {
            try
            {
                string host = SystemConfig.GetValue(RHP.Common.Enums.SystemConfig.SMTP_HOST);
                string fromEmail = SystemConfig.GetValue(RHP.Common.Enums.SystemConfig.SMTP_FROM_EMAIL);

                EmailManager emailManager = new EmailManager(host, fromEmail);

                //Use the parameters where needed, if not required use empty
                emailManager.SendEmail(To, Subject, Body, fromEmail, string.Empty, string.Empty);

                return 1;
            }
            catch (Exception ex)
            {
                return 0;
            }
        }
        /// <summary>
        /// emails will be sent based on isemail activation value in config
        /// </summary>
        /// <param name="To"></param>
        /// <param name="Subject"></param>
        /// <param name="Body"></param>
        /// <returns></returns>
        protected int LandloadSendEmail(string To, string Subject, string Body)
        {
            try
            {
                if (Boolean.Parse(
                        SystemConfig.GetValue(
                            RHP.Common.Enums.SystemConfig.IsEmailActivation)) == true)
                {
                    string host = SystemConfig.GetValue(RHP.Common.Enums.SystemConfig.SMTP_HOST);
                    string fromEmail = SystemConfig.GetValue(RHP.Common.Enums.SystemConfig.SMTP_FROM_EMAIL);

                    EmailManager emailManager = new EmailManager(host, fromEmail);

                    //Use the parameters where needed, if not required use empty
                    emailManager.SendEmail(To, Subject, string.Empty, fromEmail, string.Empty, Body);

                    return 1;
                }
                else
                {
                    return 0;
                }

            }
            catch (Exception ex)
            {
                return 0;
            }
        }
        protected int SendEmail(string To, string Subject, string Body)
        {
            try
            {
                string host = SystemConfig.GetValue(RHP.Common.Enums.SystemConfig.SMTP_HOST);
                string fromEmail = SystemConfig.GetValue(RHP.Common.Enums.SystemConfig.SMTP_FROM_EMAIL);

                EmailManager emailManager = new EmailManager(host, fromEmail);

                emailManager.SendEmail(To, Subject, string.Empty, fromEmail, string.Empty, Body);

                return 1;
            }
            catch (Exception ex)
            {
                return 0;
            }
        }
예제 #4
0
 private static void SendEmail(string subject, string emailText)
 {
     if (SystemConfig.GetValue(RHP.Common.Enums.SystemConfig.ENABLE_DEVELOPER_EMAILS) == "true")
     {
         //you will get the exception for the first time anyways
         string host = SystemConfig.GetValue(RHP.Common.Enums.SystemConfig.SMTP_HOST);
         string fromEmail = SystemConfig.GetValue(RHP.Common.Enums.SystemConfig.SMTP_FROM_EMAIL);
         EmailManager emailManager = new EmailManager(host, fromEmail);
         emailManager.SendEmail(SystemConfig.GetValue(RHP.Common.Enums.SystemConfig.DEVELOPER_EMAIL),
             subject, emailText, fromEmail, string.Empty, string.Empty);
     }
 }