コード例 #1
0
        public ImportExportEmailsForm(MailClientForm parentForm)
        {
            InitializeComponent();
            _parentForm = parentForm;

            foreach (var folder in _parentForm.FolderList.Values)
            {
                comboBoxImportTo.Items.Add(folder.FolderName);
                comboBoxExportFrom.Items.Add(folder.FolderName);
            }

            comboBoxImportTo.Items.Add("Inbox");
            comboBoxImportTo.Items.Add("Sent Emails");

            comboBoxExportFrom.Items.Add("Inbox");
            comboBoxExportFrom.Items.Add("Sent Emails");

            if (parentForm.ServerInfo.Preset != ServerInfo.ServerPreset.Gmail)
            {
                comboBoxImportFrom.Items.Add("Gmail");
            }
            if (parentForm.ServerInfo.Preset != ServerInfo.ServerPreset.Yandex)
            {
                comboBoxImportFrom.Items.Add("Yandex");
            }

            comboBoxImportFrom.Items.Add("Custom Server");
            comboBoxImportFrom.Items.Add("Browse on PC");
        }
コード例 #2
0
        public MailPreview(MailClientForm parentForm, InboxEmail inboxEmail)
        {
            InitializeComponent();

            _parentForm    = parentForm;
            tbFrom.Text    = inboxEmail.From;
            tbTo.Text      = inboxEmail.To;
            tbSubject.Text = inboxEmail.Subject;

            pictureBoxLoading.Visible = true;

            Task.Run(() =>
            {
                var message = _parentForm.MailReceiver.GetEmail(EmailType.Inbox, inboxEmail.UniqueId);
                GetAttachments(message);

                if (!string.IsNullOrEmpty(message.HtmlBody))
                {
                    this.Invoke((Action)(() => webBrowserBody.DocumentText = message.HtmlBody));
                    this.Invoke((Action)(() => webBrowserBody.Visible = true));
                }
                else if (!string.IsNullOrEmpty(message.TextBody))
                {
                    this.Invoke((Action)(() => tbBody.Text = message.TextBody));
                }

                this.Invoke((Action)(() => pictureBoxLoading.Visible = false));
                this.Invoke((Action)(() => pictureBoxLoading.Enabled = false));

                _parentForm.MailReceiver.SetMessageSeen(EmailType.Inbox, inboxEmail.UniqueId);
            });

            lbDate.Text = "Arrival Time: " + inboxEmail.ArrivalTime;
        }
コード例 #3
0
        public MailReceiver(string mailServer, int port, bool ssl, string login, string password, MailClientForm mailClientForm)
        {
            this.mailServer = mailServer;
            this.port       = port;
            this.ssl        = ssl;
            this.Login      = login;
            this.Password   = password;

            _mailClientForm = mailClientForm;
        }
コード例 #4
0
 public FolderEdit(MailClientForm parentForm, string foldername)
 {
     InitializeComponent();
     IsEdit                 = true;
     OldFolderName          = foldername;
     labelFolderAction.Text = "Enter new name";
     this.Text              = "Rename Folder";
     buttonCreate.Text      = "OK";
     _parentForm            = parentForm;
 }
コード例 #5
0
        public NewEmailForm(MailClientForm parentForm)
        {
            _parentForm = parentForm;

            _username = _parentForm.MailReceiver.Login;
            _password = _parentForm.MailReceiver.Password;
            InitializeComponent();

            if (!_username.Contains("@"))
            {
                tbFrom.Text = _username + _parentForm.ServerInfo.LoginSuffix;
            }
            else
            {
                tbFrom.Text = _username;
            }
        }
コード例 #6
0
        public MailPreview(MailClientForm parentForm, Models.CollectionEmail collectionEmail)
        {
            InitializeComponent();

            _parentForm = parentForm;

            tbFrom.Text    = collectionEmail.From;
            tbTo.Text      = collectionEmail.To;
            tbSubject.Text = collectionEmail.Subject;
            tbBody.Text    = collectionEmail.TextBody;

            if (!string.IsNullOrEmpty(collectionEmail.HtmlBody))
            {
                webBrowserBody.DocumentText = collectionEmail.HtmlBody;
                webBrowserBody.Visible      = true;
            }
            else if (!string.IsNullOrEmpty(collectionEmail.TextBody))
            {
                tbBody.Text = collectionEmail.TextBody;
            }

            lbDate.Text = "Date: " + collectionEmail.Date;
        }
コード例 #7
0
 public SearchForm(MailClientForm parentForm)
 {
     InitializeComponent();
     _parentForm = parentForm;
 }
コード例 #8
0
 public FolderEdit(MailClientForm parentForm)
 {
     InitializeComponent();
     _parentForm = parentForm;
 }
コード例 #9
0
 public ImportExportTool(MailClientForm parentForm)
 {
     _parentForm = parentForm;
 }
コード例 #10
0
 public LoginForm(MailClientForm parentForm)
 {
     InitializeComponent();
     _parentForm         = parentForm;
     comboBoxServer.Text = "Gmail";
 }