/// <summary>
 /// Base class for different folders
 /// </summary>
 /// <param name="_folderMenu">the folder menu where the folder is placed</param>
 /// <param name="_mw">the main window</param>
 public Folders(FolderMenu _folderMenu, MainWindow _mw)
 {
     InitializeComponent();
     folderMenu = _folderMenu;
     user = folderMenu.user;
     folderImg = "folder.jpg";
     mw = _mw;
 }
 /// <summary>
 /// Base class for different folders
 /// </summary>
 /// <param name="_folderMenu">the folder menu where the folder is placed</param>
 /// <param name="_mw">the main window</param>
 public Folders(FolderMenu _folderMenu, MainWindow _mw)
 {
     InitializeComponent();
     folderMenu = _folderMenu;
     user       = folderMenu.user;
     folderImg  = "folder.jpg";
     mw         = _mw;
 }
Exemple #3
0
        /// <summary>
        /// Send the email
        /// </summary>
        /// <param name="to">who is the email to?</param>
        /// <param name="subject">the subject of the email</param>
        /// <param name="body">the body of the email</param>
        /// <param name="user">the user there should send the email</param>
        public void sendMail(string to, string subject, string body,User.user user)
        {
            MailMessage mail = new MailMessage();
            mail.From = new MailAddress(user.email, user.email);

            mail.To.Add(to);

            mail.Subject = subject;
            mail.Body = body;
            mail.IsBodyHtml = true;

            SmtpClient smtp = new SmtpClient(user.pop3);
            smtp.Send(mail);
        }
 /// <summary>
 /// The handler of both the database and pop 3
 /// </summary>
 /// <param name="_user">the user there should be handled</param>
 /// <param name="newMailUser">if its a new user</param>
 public MailDatabaseHandler(User.user _user, bool newMailUser = false)
 {
     user = _user;
     popClient  = new PopClient(user);
     SetSeenUids();
     if (newMailUser)
     {
         getMailsThread.Start(this);
     }
     else
     {
         getMailsThread.Start(this);
     }
     DispatcherTimer ConnectionTimer = new DispatcherTimer();
     ConnectionTimer.Tick += new EventHandler(ConnectionTimer_Tick);
     ConnectionTimer.Interval = new TimeSpan(0, 1, 0);
     ConnectionTimer.Start();
 }
Exemple #5
0
        /// <summary>
        /// The handler of both the database and pop 3
        /// </summary>
        /// <param name="_user">the user there should be handled</param>
        /// <param name="newMailUser">if its a new user</param>
        public MailDatabaseHandler(User.user _user, bool newMailUser = false)
        {
            user      = _user;
            popClient = new PopClient(user);
            SetSeenUids();
            if (newMailUser)
            {
                getMailsThread.Start(this);
            }
            else
            {
                getMailsThread.Start(this);
            }
            DispatcherTimer ConnectionTimer = new DispatcherTimer();

            ConnectionTimer.Tick    += new EventHandler(ConnectionTimer_Tick);
            ConnectionTimer.Interval = new TimeSpan(0, 1, 0);
            ConnectionTimer.Start();
        }
 /// <summary>
 /// Adds the user to the settings
 /// </summary>
 /// <param name="sender">sender</param>
 /// <param name="e">event</param>
 private void btnCon_Click(object sender, RoutedEventArgs e)
 {
     int port;
     if (!String.IsNullOrEmpty(txtEmail.Text))
     {
         if (!String.IsNullOrEmpty(txtPass.Password))
         {
             if (!String.IsNullOrEmpty(txtPoP.Text))
             {
                 if (!String.IsNullOrEmpty(txtPort.Text) && int.TryParse(txtPort.Text, out port))
                 {
                     User.user newUser = new User.user();
                     newUser.email = txtEmail.Text;
                     newUser.password = txtPass.Password;
                     newUser.pop3 = txtPoP.Text;
                     newUser.port = port;
                     newUser.ssl = Convert.ToBoolean(chbSsl.IsChecked.ToString());
                     User.AddUser(newUser);
                     DialogResult = true;
                     Close();
                 }
                 else
                 {
                     MessageBox.Show("Port er ikke et tal eller/og er tom");
                 }
             }
             else
             {
                 MessageBox.Show("Pop3 er tom");
             }
         }
         else
         {
             MessageBox.Show("Password er tom");
         }
     }
     else
     {
         MessageBox.Show("Email er tom");
     }
 }
 /// <summary>
 /// Adds the user to the settings
 /// </summary>
 /// <param name="sender">sender</param>
 /// <param name="e">event</param>
 private void btnCon_Click(object sender, RoutedEventArgs e)
 {
     int port;
     if (!String.IsNullOrEmpty(txtEmail.Text))
     {
         if (!String.IsNullOrEmpty(txtPass.Password))
         {
             if (!String.IsNullOrEmpty(txtPoP.Text))
             {
                 if (!String.IsNullOrEmpty(txtPort.Text) && int.TryParse(txtPort.Text, out port))
                 {
                     User.user newUser = new User.user();
                     newUser.email = txtEmail.Text;
                     newUser.password = txtPass.Password;
                     newUser.pop3 = txtPoP.Text;
                     newUser.port = port;
                     newUser.ssl = Convert.ToBoolean(chbSsl.IsChecked.ToString());
                     User.AddUser(newUser);
                     DialogResult = true;
                     Close();
                 }
                 else
                 {
                     MessageBox.Show("Port er ikke et tal eller/og er tom");
                 }
             }
             else
             {
                 MessageBox.Show("Pop3 er tom");
             }
         }
         else
         {
             MessageBox.Show("Password er tom");
         }
     }
     else
     {
         MessageBox.Show("Email er tom");
     }
 }
 /// <summary>
 /// Folder menu contain a user and all its folders
 /// </summary>
 /// <param name="_user">The user for this folder menu</param>
 /// <param name="_mw">the main window</param>
 public FolderMenu(User.user _user, MainWindow _mw)
 {
     user = _user;
     mw = _mw;
     InitializeComponent();
 }
 /// <summary>
 /// the pop 3 client
 /// </summary>
 /// <param name="_user">the user for this pop 3 client</param>
 public PopClient(User.user _user)
 {
     user = _user;
 }
 /// <summary>
 /// Folder menu contain a user and all its folders
 /// </summary>
 /// <param name="_user">The user for this folder menu</param>
 /// <param name="_mw">the main window</param>
 public FolderMenu(User.user _user, MainWindow _mw)
 {
     user = _user;
     mw   = _mw;
     InitializeComponent();
 }
 /// <summary>
 /// the pop 3 client
 /// </summary>
 /// <param name="_user">the user for this pop 3 client</param>
 public PopClient(User.user _user)
 {
     user = _user;
 }