receiving emails WPF Application (not forms)
darren guest
1
Reputation point
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