private void Button_Click(object sender, RoutedEventArgs e) { User = new User(TextBoxLogin.Text, TextBoxPassword.Text); Mailad = new MailAdapter("imap.gmail.com", 993, User.Email, User.Password); WindowMail winmail = new WindowMail(User, Mailad); winmail.Show(); }
public void SendMail(User suser, string sendto, string subject, string body) { if (suser != null) { MailAddress from = new MailAddress(suser.Email, suser.Name); MailAddress to = new MailAddress(sendto); MailMessage mesg = new MailMessage(from, to); mesg.Subject = subject; mesg.Body = body; client.Send(mesg); } }
public ClientSmtp(string host, int port, User usr) { Host = host; Port = port; user = usr; client = new SmtpClient(host, port) { Credentials = new NetworkCredential(user.Email, user.Password), EnableSsl = true }; }
public WindowMail(User user, MailAdapter mail) { InitializeComponent(); Mailadp = mail; User = user; ListBoxFolder.ItemsSource = mail.ListMailboxes(); IEnumerator messageenum = Mailadp.GetEnumerator(); MessEnumerator = messageenum; uint uid = mail.GetMailboxInfo().NextUid; IEnumerable<uint> uids = mail.Search(SearchCondition.Unseen()); foreach (uint uidd in uids) { MailMessage message = mail.GetMessage(uidd); mail.MailMessages.Add(message); ListBoxMail.Items.Add(message.From + " " + message.Subject); } }
public WindowSend(User user) { InitializeComponent(); Usr = user; }