Example #1
0
        /// <summary>
        /// Send SimpleMAPI email
        /// </summary>
        public void SendMapi(string exceptionReport)
        {
            var    mapi         = new Mapi();
            string emailAddress = _reportInfo.EmailReportAddress.IsEmpty()
                                      ? _reportInfo.ContactEmail
                                      : _reportInfo.EmailReportAddress;

            mapi.AddRecipient(emailAddress, null, false);
            AddMapiAttachments(mapi);
            mapi.Send(EmailSubject, exceptionReport, true);
        }
Example #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();
        }