Пример #1
0
        /// <summary>
        /// get smtp details for mail sending
        /// </summary>
        /// <param name="emailTo">email will send to</param>
        /// <param name="password">password </param>
        /// <param name="body">message body</param>
        public static void GetSmtpDetail(string emailTo, string body, string subject)
        {
            try
            {
                DecisionPointRepository objdecisionPointRepository = new DecisionPointRepository();
                // return objdecisionPointRepository.Getsmtpdetails();
                DecisionPointMailMatixBAL.Request.SMTPDetail objSMTPDetail = new DecisionPointMailMatixBAL.Request.SMTPDetail();//objdecisionPointRepository.Getsmtpdetails();

                //Set Mail credentials
                BusinessEmail objBusinessEmail = new BusinessEmail();
                objBusinessEmail.EmailBody           = body;
                objBusinessEmail.EmailFrom           = objdecisionPointRepository.Getsmtpdetails().EmailSmtpServer;//objSMTPDetail.EmailSmtpServer;
                objBusinessEmail.EmailTo             = emailTo;
                objBusinessEmail.EmailSubject        = subject;
                objBusinessEmail.EmailSmtpServerHost = objdecisionPointRepository.Getsmtpdetails().EmailSmtpServerHost;
                objBusinessEmail.EmailSmtpServerPort = objdecisionPointRepository.Getsmtpdetails().EmailSmtpServerPort;
                objBusinessEmail.EmailSmtpServerSSL  = objdecisionPointRepository.Getsmtpdetails().EmailSmtpServerSSL;
                objBusinessEmail.EmailPassword       = objdecisionPointRepository.Getsmtpdetails().PasswordSmtpServer;
                objBusinessEmail.PasswordSmtpServer  = objdecisionPointRepository.Getsmtpdetails().PasswordSmtpServer;
                objBusinessEmail.EmailSmtpServer     = objdecisionPointRepository.Getsmtpdetails().EmailSmtpServer;
                SendMail(objBusinessEmail);
            }
            catch
            {
                throw;
            }
        }