Beispiel #1
0
 private void toolStripMenuNewMail_Click(object sender, EventArgs e)
 {
     //-- Context Menu (New Mail)
     frmMailView frmMail = new frmMailView(
         Bootstrap.Instance().Settings.AccountAddress,
         this.livContactCurrent.Text.Trim() );
     if (DialogResult.OK == frmMail.ShowDialog())
     {
         this.SendMail(frmMail);
     }
 }
Beispiel #2
0
        public void ShowEditMail(string id)
        {
            //--- Show Mail Edit dialog
            try
            {
                foreach (Hashtable t in resMessages.return_)
                {
                    if (id == Convert.ToString(t["id"]) )
                    {
                        Status = "Retrieving e-mail ...";
                        this.Cursor = Cursors.WaitCursor; // wait a while
                        Result resMail = Bootstrap.Instance().Talker.GetMail(id);
                        ErrorHandler.checkBizResult(resMail);
                        Status = "Done.";

                        frmMailView frmMail = new frmMailView(resMail.return_[0]);
                        frmMail.ShowDialog();
                        break;
                    }
                }
            }
            catch (Exception ex)
            {
                Status = "Retrieving e-mail failed !";
                new ErrorHandler(ex).Error();
            }
            finally
            {
                this.Cursor = Cursors.Arrow;
            }
        }
Beispiel #3
0
 private void btnNewMail_Click(object sender, EventArgs e)
 {
     //--- [New Mail] button clicked
     frmMailView frmMail = new frmMailView(Bootstrap.Instance().Settings.AccountAddress);
     if (DialogResult.OK == frmMail.ShowDialog())
     {
         this.SendMail(frmMail);
     }
 }
Beispiel #4
0
        public void SendMail(frmMailView frmMail)
        {
            //--- Send Mail with collected data
            try
            {
                Status = "Sending email ...";
                this.Cursor = Cursors.WaitCursor; // wait a while

                Result resSendMail = Bootstrap.Instance().Talker.SendMail(
                    frmMail.To,
                    frmMail.Cc,
                    frmMail.Bcc,
                    frmMail.Subject,
                    frmMail.Body,
                    MailBoxPassword
                    );
                ErrorHandler.checkBizResult(resSendMail);

                Status = "Email sent.";
                if (resSendMail.code == 0)
                    MessageBox.Show("E-Mail sent successfully", "Status", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            catch (Exception ex)
            {
                Status = "Sending email failed !";
                new ErrorHandler(ex).Error();
            }
            finally
            {
                this.Cursor = Cursors.Arrow;
            }
        }