Exemple #1
0
        public CommonRtnEntity GetEmailContent(string userName, string pwd, string keyWords, int tryCount = 1)
        {
            CommonRtnEntity rtnInfo = new CommonRtnEntity();
            string          rtnmsg  = "";
            bool            result  = true;

            if (string.IsNullOrEmpty(userName))
            {
                result = false;
                rtnmsg = "邮箱账号不能为空!";
            }
            else if (string.IsNullOrEmpty(pwd))
            {
                result = false;
                rtnmsg = "邮箱密码不能为空!";
            }

            if (result)
            {
                IEmailServices advertisementServices = new EmailServices();
                string         content = "";
                result          = advertisementServices.GetEmailContent(userName, pwd, keyWords, out content, out rtnmsg, tryCount);
                rtnInfo.Success = result;
                rtnInfo.Data    = content;
                rtnInfo.Message = result ? "获取成功!" : rtnmsg;
            }
            else
            {
                rtnInfo.Success = result;
                rtnInfo.Data    = "";
                rtnInfo.Message = rtnmsg;
            }
            return(rtnInfo);
        }