示例#1
0
        public ResponseModel send()
        {
            mensagem.auth("*****@*****.**", "lee1004"); //1)web.config포함 -> 2)cms관리 mail 포함
            mensagem.fromAlias = "kesso.kr";                  //1)web.config포함 -> 2)cms관리 mail 포함

            mensagem.Priority = 0;

            if (this.P_TYPE != P_TYPE_DIRECT_value)
            {
                return(xmlCommonUtil.ResponseWriteErrorMSG("[p_type = direct] 이외 아직까지 구현되지 않았습니다."));
            }

            mensagem.Html = false;

            if (string.IsNullOrEmpty(this.SUBJECT))
            {
                return(xmlCommonUtil.ResponseWriteErrorMSG("제목이 없습니다.[subject = ?]"));
            }
            mensagem.Subject = this.SUBJECT; //"test 한글2";
            mensagem.Message = this.MESSAGE; // "test 한글3";

            if (TO.Length == 0)
            {
                return(xmlCommonUtil.ResponseWriteErrorMSG("받을 사람이 없습니다.[to = ?]"));
            }
            foreach (string to in TO)
            {
                mensagem.To = to;
            }

            //FileCommonUtil fcu = new FileCommonUtil();
            //string fileFullPath = fcu.CheckAttachmentKeyAndReturnFullFilePath();//첨부파일 1개기준

            string fileFullPath = fileCommonUtil.CheckAttachmentKeyAndReturnFullFilePath();

            if (!string.IsNullOrEmpty(fileFullPath))
            {
                mensagem.attach(fileFullPath);
            }

            bool success = mensagem.send();

            if (!success)
            {
                //추후 error로그 저장 후 메시지 전송할 것.
#if FOR_TEST
                return(xmlCommonUtil.ResponseWriteErrorMSG("UpdateTwitPic Fail!!(" + fileFullPath + ")"));
#else
                return(xmlCommonUtil.ResponseWriteErrorMSG("UpdateTwitPic Fail!!"));
#endif
            }

            //추후 로그 저장 후 메시지 전송할 것.

#if FOR_TEST
            return(xmlCommonUtil.ResponseWriteMSG("1", "UpdateTwitPic Success!!(" + fileFullPath + ")"));
#else
            return(xmlCommonUtil.ResponseWriteMSG("1", "UpdateTwitPic Success!!"));
#endif
        }