Beispiel #1
1
        public SendForm( ref Mapi rma,string filename,string thumbnailPath )
        {
            ma = rma;
            //
            // Required for Windows Form Designer support
            //

            InitializeComponent();
            this.filename=filename;
            this.filename=filename.Replace("/","\\");
            ma.Reset();
            this.lblComPath.Text=filename;
            this.AttachPic.Image=Image.FromFile(thumbnailPath);

            //int n = this.comboAttachm.Items.Add(filename);
            //comboAttachm.SelectedIndex = n;
        }
Beispiel #2
0
        /// <summary>
        /// Send SimpleMAPI email
        /// </summary>
        public void SendMapi(string exceptionReport, IntPtr windowHandle)
        {
            var mapi = new Mapi();
            mapi.Logon(windowHandle);
            mapi.Reset();

        	var emailAddress = string.IsNullOrEmpty(_reportInfo.EmailReportAddress)
        	                   	? _reportInfo.ContactEmail
        	                   	: _reportInfo.EmailReportAddress;

            mapi.AddRecipient(emailAddress, null, false);
            AttachMapiScreenshotIfRequired(mapi);
            mapi.Send(EmailSubject, exceptionReport, true);
            mapi.Logoff();
        }
Beispiel #3
0
        //        public void Send_textWithCC(string to,string subject,string textMail,string textCCMailAddress )
        //        {
        //
        //        }
        public void Send_text(string to,string subject,string textMail )
        {
            try
            {
                ma1= new Mapi();
                ma1.AddRecip(to, null, false );
                /*
                if( textCC.Text != null )
                {
                    if( textCC.Text.Length > 0 )
                        ma.AddRecip( textCC.Text, null, true );
                }
                */
                //lblStatus.Text="Current Status :  Sending Message";
                if( ! ma1.Send( subject, textMail ) )
                    MessageBox.Show( this, "MAPISendMail failed! " + ma1.Error(), "Send Mail", MessageBoxButtons.OK, MessageBoxIcon.Warning );

                ma1.Reset();
                //this.Close();
            }
            catch(Exception exp)
            {
                MessageBox.Show(exp.Message.ToString());
            }
        }
Beispiel #4
0
 private void AttachMapiScreenshotIfRequired(Mapi mapi)
 {
     if (_reportInfo.ScreenshotAvailable)
         mapi.Attach(ScreenshotTaker.GetImageAsFile(_reportInfo.ScreenshotImage));
 }