コード例 #1
0
        public MsgEntity SendMail(MailContent mailContent)
        {
            MsgEntity r;

            string sessionName = WebConfigurationManager.AppSettings["loginSessionName"];

            if (HttpContext.Current.Session[sessionName] != null)
            {
                SendMail sendMail = new SendMail();

                string   toEmail = mailContent.toEmail;
                string[] cc      = mailContent.cc;
                string   title   = mailContent.title;
                string   content = mailContent.content;

                if (sendMail.Do(toEmail, cc, title, content))
                {
                    r = ResponseMsg.SetEntity(out r, 5000);
                }
                else
                {
                    r = ResponseMsg.SetEntity(out r, 5101);
                }
            }
            else
            {
                ResponseMsg.SetEntity(out r, 4102);
            }

            return(r);
        }