Esempio n. 1
0
        private void PostMail(MailBaseData _MailBaseData, string recipientsAddressRange,
                              string MailSubject, string Describe, string File_Path)
        {
            MailSubject = MailSubject + " (" + WIPCommon.ForamtCurDateTime() + ")";//任务名称
            Describe   += "<br/><br/>";
            Describe   += "消息来自主机:" + WIPCommon.GetHostName() + "<br/>";
            Describe   += "主机发生时间:" + WIPCommon.ForamtCurDateTime() + "<br/>";
            IDictionary <string, object> logDict = new Dictionary <string, object>();

            logDict.Add("recipientsAddressRange", recipientsAddressRange);
            logDict.Add("MailSubject", MailSubject);
            logDict.Add("Describe", Describe);
            logDict.Add("File_Path", File_Path);
            ExceptionInfoEntity exception = WipLogHelper.GetExceptionInfo <IDictionary <string, object> >(namespaceName, "MailSending", logDict, "", "");

            try
            {
                if (File_Path == null)
                {
                    File_Path = "";
                }

                SMTPHelper.MailSending(_MailBaseData, _recipientsAddressRange, MailSubject, Describe.ToString(), "");
            }
            catch (Exception ex)
            {
                WipLogHelper.GetExceptionInfoForError(ex, ref exception);
                WipLogHelper.WriteExceptionInfo(exception);
            }
        }