Beispiel #1
0
 public Form1()
 {
     InitializeComponent();
     if (startMDI())
     {
         _mySettings = new eMDIeMailSettings();
         _sendMail = new sendMail(_mySettings.MailAccount);
         if (!initMail())
         {
             MessageBox.Show("eMail account invalid. Setup an account and restart!");
             stopMDI();
             Application.Exit();
         }
         System.Diagnostics.Debug.WriteLine(_mySettings.Recipient);
     }
     btnSend.Enabled = false;
 }
Beispiel #2
0
 private void mnuMail_Click(object sender, EventArgs e)
 {
     string sAccountIn = "";
     MailSettings ms = new MailSettings(ref sAccountIn);
     ms.account = _sendMail.account;
     ms.sRecipient = _sendMail._to;
     if (ms.ShowDialog() == DialogResult.OK)
     {
         _sendMail.Dispose();
         _sendMail = new sendMail(sAccountIn);// ms.account.Name);
         if (!_sendMail.bIsValidAccount)
         {
             MessageBox.Show("eMail account invalid. Please setup valid eMail account!");
         }
         else
         {
             //string sAccount = ms.sAccountName;
             _sendMail = new sendMail(sAccountIn);
             //_sendMail.account = ms.account;
             _sendMail._to = ms.sRecipient;
         }
     }
     if(_sendMail.bIsValidAccount)
         btnSend.Enabled = true;
     else
         btnSend.Enabled = false;
     ms.Dispose();
 }
Beispiel #3
0
 private void btnGmail_Click(object sender, EventArgs e)
 {
     sendMail _sendMail = new sendMail();
     _sendMail.createAccountGoogle();
     _sendMail.Dispose();
     mnuCancel_Click(null, null);
 }
Beispiel #4
0
        private bool initMail()
        {
            bool bRet = false;
            _sendMail = new sendMail(_mySettings.MailAccount);
            if (!_sendMail.bIsValidAccount)
            {
                MessageBox.Show("eMail account invalid. Setup an account and restart!");
                string sAccount = _mySettings.MailAccount;
                MailSettings ms = new MailSettings(ref sAccount);
                if (ms.ShowDialog() == DialogResult.OK)
                {
                    _sendMail.setAccount(sAccount);// ms.account.Name);
                    bRet = true;
                }
                ms.Dispose();
            }
            else
                bRet = true;

            return bRet;
        }
Beispiel #5
0
 private void createGmail()
 {
     sendMail _sendMail = new sendMail();
     if (_sendMail.createAccountGoogle())
         _account = _session.EmailAccounts["Google Mail"];
     _sendMail.Dispose();
 }