Esempio n. 1
0
        private bool connexion_SMTP()
        {
            bool         connect = false;
            ComboBoxPort stmp    = (ComboBoxPort)comboBox_PortSMTP.SelectedItem;

            typePortSMTP = stmp.ValuePort;
            Debug.WriteLine("Numéro du port SMTP : {0}", typePortSMTP);
            FormLogin dlg = new FormLogin();

            if (dlg.ShowDialog() == true)
            {
                NetworkCredential basicCredential = new NetworkCredential(dlg.userName, dlg.login);
                smtpClient             = new SmtpClient(addr_serv_smtp.Text, typePortSMTP);
                smtpClient.Credentials = basicCredential;
                connect = true;
            }

            return(connect);
        }
Esempio n. 2
0
        private void button_connect_POP_Click(object sender, RoutedEventArgs e)
        {
            //Console.WriteLine("Numéro du port : {0} - Type de l'option : {1}");
            ComboBoxPort pop = (ComboBoxPort)comboBox_type_connection_POP.SelectedItem;

            typePortPOP = pop.ValuePort;
            Debug.WriteLine("Numéro du port POP : {0}", typePortPOP);
            //pop3Client = new Pop3Client();
            Boolean connect = (Boolean)this.Resources["isPOPConnected"];

            if (connect)
            {
                deconnexion_POP();
            }
            else
            {
                connect = connexion_POP();
            }

            resetIHM_POP(connect);
        }