i'm using Mailkit to get the subject of emails , it's working for me but i need to get the text body to , any one could help me any one could help me thanks
async Task FetchMessageSummariesAsync(bool print)
{
IList<IMessageSummary> fetched = null;
do
{
try
{
// fetch summary information for messages that we don't already have
startIndex = startIndex + messages.Count;
fetched = client.Inbox.Fetch(startIndex, -1, MessageSummaryItems.Full | MessageSummaryItems.UniqueId, cancel.Token);
break;
}
catch (ImapProtocolException)
{
// protocol exceptions often result in the client getting disconnected
await ReconnectAsync();
}
catch (IOException)
{
// I/O exceptions always result in the client getting disconnected
await ReconnectAsync();
}
} while (true);
messages.Clear();
foreach (var message in fetched)
{
if (print)
Console.WriteLine("new message: {0}", message.Envelope.Subject);
messages.Add(message);
}
// ---- Insert Data in Database
}