示例#1
0
    public void UploadAndPost()
    {
        FileCommonUtil fcu          = new FileCommonUtil();
        string         fileFullPath = fcu.CheckAttachmentKeyAndReturnFullFilePath();//첨부파일 1개기준

        if (string.IsNullOrEmpty(fileFullPath))
        {
            return;
        }

        gmail mensagem = new 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
            xmlCommonUtil.ResponseWriteErrorMSG("UpdateTwitPic Fail!!(" + fileFullPath + ")");
#else
            xmlCommonUtil.ResponseWriteErrorMSG("UpdateTwitPic Fail!!");
#endif
            return;
        }

        //추후 로그 저장 후 메시지 전송할 것.
#if FOR_TEST
        xmlCommonUtil.ResponseWriteMSG("1", "UpdateTwitPic Success!!(" + fileFullPath + ")");
#else
        xmlCommonUtil.ResponseWriteMSG("1", "UpdateTwitPic Success!!");
#endif
    }
示例#2
0
        public void SendMailWithUiPath(string username, string password, string subject, string message, string[] to, string[] cc)
        {
            gmail gmail = new gmail();

            gmail.auth(username, password);
            gmail.Subject = subject;
            gmail.Message = message;
            foreach (string t in to)
            {
                gmail.To = t;
            }
            foreach (string c in cc)
            {
                gmail.Cc = c;
            }
            gmail.send();
        }
示例#3
0
    public void 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)
        {
            xmlCommonUtil.ResponseWriteErrorMSG("[p_type = direct] 이외 아직까지 구현되지 않았습니다.");
            return;
        }

        mensagem.Html = false;

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

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

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

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

        bool success = mensagem.send();

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

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