receiving emails WPF Application (not forms)

darren guest 1 Reputation point
2020-10-03T21:45:51.377+00:00

hi all

i'm trying to receive emails in my app and am struggling to work out the Xaml window code.

i think my back end code works which is as follows

private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            using (var client = new ImapClient())
            {
                client.Connect("imap.gmail.com", 993, true);

                client.Authenticate("username", "password");

                var inbox = client.Inbox;
                inbox.Open(FolderAccess.ReadOnly);

                Console.WriteLine("Total messages: {0}", inbox.Count);
                Console.WriteLine("Recent messages: {0}", inbox.Recent);

                for (int i = 0; i < inbox.Count; i++)
                {
                    var message = inbox.GetMessage(i);
                    Console.WriteLine("Subject: {0}", message.Subject);
                }

                client.Disconnect(true);
            }

can anyone help me with how to write the email contents into textboxs or something and any cs to make them bind if needed.

thanks

this is driving me crazy

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,701 questions
{count} votes