Skip to content

Instantly share code, notes, and snippets.

@tucaz
Created January 30, 2012 23:36
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 tucaz/1707543 to your computer and use it in GitHub Desktop.
Save tucaz/1707543 to your computer and use it in GitHub Desktop.
Sample usage of AE.NET.Mail
//Sample usage of AE.NET.Mail
//https://github.com/andyedinborough/aenetmail
using (var pop = new AE.Net.Mail.Pop3Client(_host, _username, _password, _port, _useSSL))
{
var count = pop.GetMessageCount();
for (var i = count - 1; i >= 0; i--)
{
var msg = pop.GetMessage(i, false);
if (msg.Attachments.Any(x => x.Headers["Content-Disposition"].Value == "attachment"))
{
var attachment = msg.Attachments.First(x => x.Headers["Content-Disposition"].Value == "attachment");
attachment.Save(@"C:\temp\attachment.pdf");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment