APG.CodeHelper.ExceptionHandler.LogException.SendFileToEmail C# (CSharp) Method

SendFileToEmail() public static method

�������� ����� �� ������ ����� ������ Outlook
public static SendFileToEmail ( string LogFileName ) : void
LogFileName string ���� �������� � ������� �� ������
return void
        public static void SendFileToEmail(string LogFileName)
        {
            /* --- ���������� � TEMP ������� ------*/
            string tempPath = Environment.GetEnvironmentVariable("TEMP")+"\\";

            //�������� ��� �����
            string ZipFileName = tempPath+LogFileName.Remove(0, LogFileName.LastIndexOf("\\")+1);
            ZipFileName = ZipFileName.Substring(0, ZipFileName.LastIndexOf('.'))+".ZIP";

            // ��������� �����
            APG.CodeHelper.CompressionHelper.CompressFile(LogFileName, ZipFileName);

            const string messageBody = "��� ������ �������� ���������� �� �������������� ��������, ��������� ��� ���������� ����������";
            const string messageSubj =  "����� �� ������";

            try
            {
                APG.CodeHelper.MAPIHelper.SendMAPIMessage(ZipFileName, ZipFileName, messageBody, messageSubj, "[email protected]");
            }
            finally
            {
                File.Delete(ZipFileName);
            }
        }