Created
January 30, 2012 23:36
-
-
Save tucaz/1707543 to your computer and use it in GitHub Desktop.
Sample usage of AE.NET.Mail
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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