Skip to content

Instantly share code, notes, and snippets.

@catlion
Created September 8, 2011 19:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save catlion/1204396 to your computer and use it in GitHub Desktop.
Save catlion/1204396 to your computer and use it in GitHub Desktop.
equinox
public static IEnumerable<MessageDetails> Folder(ImapClient ic, string folderName)
{
var selRes = ic.Select(folderName);
if (!selRes.IsOk) {
throw new InvalidOperationException(selRes.ReasonForFailure);
}
return ic.Messages.Where(x => x.Uid >= uidNext).Select(y => new MessageDetails {
From = y.From.FirstOrDefault().ToString(),
Uid = y.Uid,
MessageId = y.Envelope.MessageId,
Subject = y.Subject
}).ToList();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment