-
Notifications
You must be signed in to change notification settings - Fork 1
/
Program.cs
43 lines (38 loc) · 1.26 KB
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
using System;
using System.Collections.Generic;
/*
Stefan Holmberg
http://aspcode.net
*/
namespace ReadPopMail
{
class Program
{
static void Main(string[] args)
{
var server = "pop3.live.com";
var port = 995;
var user = "[email protected]";
var pwd = "abc123";
var usessl = true;
var deleteafterread = false;
var errors = new List<string>();
var emails = MailHelper.Popper.GetAllEmails(server, port, user, pwd, usessl, deleteafterread, ref errors);
if (emails != null)
{
foreach (var email in emails)
{
Console.WriteLine( "Email:" + email.Uid);
Console.WriteLine("From:" + email.From);
Console.WriteLine("Subject:" + email.Subject);
if (email.HtmlBody.Length > 0)
Console.WriteLine("HtmlBody:" + email.HtmlBody);
if (email.TextBody.Length > 0)
Console.WriteLine("TextBody:" + email.TextBody);
}
}
foreach(var err in errors)
Console.WriteLine("Error occured:" + err);
}
}
}