/// <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(); }
/// <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; }