Ejemplo n.º 1
0
        private ResponseModel SendMMS()
        {
            int MMSSeq = -1;

            //FileCommonUtil fcu = new FileCommonUtil();
            //string filePath = fcu.CheckAttachmentKeyAndReturnFullFilePath();

            string filePath = fileCommonUtil.CheckAttachmentKeyAndReturnFullFilePath();

            //첨부할 파일이 로컬서버(attachment_key)에 있을 경우 - 첨부파일 1개 기준
            if (!string.IsNullOrEmpty(filePath))
            {
                this.SaveMMSFiles(SEND_MSG_STRING, MMS_SUBJECT, filePath, ref MMSSeq);
            }
            //첨부할 파일이 외부서버(http)에 있을 경우
            else
            {
                this.SaveMMSFiles(FILE_COUNT, SEND_MSG_STRING, MMS_SUBJECT, FILE_LIST, ref MMSSeq);
            }

            if (int.Equals(-1, MMSSeq))
            {
                return(xmlCommonUtil.ResponseWriteErrorMSG("MMS 발송 중 오류 발생(첨부파일 데이터 디비 저장이 올바르게 이루어지지 않았습니다.)"));
            }

            return(this.SendSMS(RECEIVER_PHONE, SENDER_PHONE, string.Empty, SEND_DATE, MSG_TYPE, MMSSeq));
        }
Ejemplo n.º 2
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
        }
        public ResponseModel UploadAndPost()
        {
            //FileCommonUtil fcu = new FileCommonUtil();
            //string fileFullPath = fcu.CheckAttachmentKeyAndReturnFullFilePath();//첨부파일 1개기준

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

            if (string.IsNullOrEmpty(fileFullPath))
            {
                return(xmlCommonUtil.ResponseWriteErrorMSG("Could not find file path.!!(" + fileFullPath + ")"));
            }

            //gmail mensagem = new gmail();
            var mensagem = gmail;

            mensagem.auth("*****@*****.**", "lee1004");      //1)web.config포함 -> 2)cms관리 포함
            mensagem.fromAlias = "kesso.kr";                       //1)web.config포함 -> 2)cms관리 포함
            mensagem.To        = "*****@*****.**"; //1)web.config포함 -> 2)cms관리 포함

            mensagem.Message  = "";
            mensagem.Priority = 0;
            mensagem.Html     = false;

            mensagem.Subject = this.MESSAGE;//"@ks2colorworld test 한글2 ";

            mensagem.attach(fileFullPath);

            /*
             * if (!string.IsNullOrEmpty(this.ATTACHMENT_KEY))//attachment_key
             * {
             *  FileCommonUtil fcu = new FileCommonUtil();
             *  mensagem.attach(fcu.ReturnFileFullPath(this.ATTACHMENT_KEY));
             *  //mensagem.attach(@"C:\_WAS\1_service_kesso_kr\upload\photoservice\-\photoservice_20100830121937.jpg");
             * }
             */
            //mensagem.zip("nomedoficheiro.zip", "password");
            bool success = mensagem.send();

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

            //추후 로그 저장 후 메시지 전송할 것.
#if FOR_TEST
            return(xmlCommonUtil.ResponseWriteMSG("1", "UpdateTwitPic Success!!(" + fileFullPath + ")"));
#else
            return(xmlCommonUtil.ResponseWriteMSG("1", "UpdateTwitPic Success!!"));
#endif
        }