private void Mail(FileInfo F)
        {
            try
            {
                Mapi mapi = new Mapi();

                mapi.AddAttachment(F.FullName);
                mapi.SendMailPopup("MFB : " + _NomFichierSansExt, "");
            }
            catch (Exception _Exception)
            {
                Log.Methode <ApercuAvantImpression>();
                Log.Message(_Exception);
            }
        }
示例#2
0
 public bool PackSendImage()
 {
     try
     {
         if (_outputBitmap == null)
         {
             throw new Exception("Нет изображения");
         }
         var fileName = Path.GetTempPath() + Guid.NewGuid() + ".bmp";
         _outputBitmap.Save(fileName);
         var mapi = new Mapi();
         mapi.AddAttachment(fileName);
         mapi.SendMailPopup("", "");
         File.Delete(fileName);
         return(true);
     }
     catch (Exception exception)
     {
         XtraMessageBox.Show(exception.Message);
     }
     return(false);
 }
示例#3
0
 public bool UnpackSendFile()
 {
     try
     {
         if (string.IsNullOrWhiteSpace(unpackFile.RtfText))
         {
             throw new Exception("Нет текста");
         }
         var fileName = Path.GetTempPath() + Guid.NewGuid() + ".rtf";
         using (var writer = File.CreateText(fileName))
             writer.Write(unpackFile.RtfText);
         var mapi = new Mapi();
         mapi.AddAttachment(fileName);
         mapi.SendMailPopup("", "");
         File.Delete(fileName);
         return(true);
     }
     catch (Exception exception)
     {
         XtraMessageBox.Show(exception.Message);
     }
     return(false);
 }