Exemplo n.º 1
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();
 }
Exemplo n.º 2
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;
        }