public static void Main(string[] args) { POP3Connection mails = new POP3Connection( args[0], args[1], args[2]); mails.Open(); int messcount = mails.MessageCount(); Console.WriteLine("MESSAGES COUNT: {0}",messcount); foreach (short s in mails.List()) Console.WriteLine(s); mails.Close(); }
public static void Main(string[] args) { POP3Connection mails = new POP3Connection( args[0], args[1], args[2]); mails.Open(); int messcount = mails.MessageCount(); Console.WriteLine("MESSAGES COUNT: {0}",messcount); POP3Message[] msgs = mails.GetMessageRange(messcount-21,messcount-1,false); foreach (POP3Message msg in msgs) { Console.WriteLine("{0} \n{1} \n{2} \n\n", msg.From.Trim(), msg.Subject.Trim(), msg.Date.Trim()); } mails.Close(); }
public static void Main(string[] args) { POP3Connection mails = new POP3Connection( args[0], args[1], args[2]); mails.Open(); short messcount = mails.MessageCount(); Console.WriteLine("MESSAGES COUNT: {0}",messcount); short[] q = mails.List(); POP3Message msg = mails.Retr(q[q.GetUpperBound(0)]); Console.WriteLine("MESSAGE TO:\t {0}", msg.To); Console.WriteLine("MESSAGE FROM:\t {0}", msg.From); Console.WriteLine("MESSAGE SUBJECT: {0}", msg.Subject); Console.WriteLine("MESSAGE DATE:\t {0}", msg.Date); Console.WriteLine("--- MESSAGE ---\n {0}", msg.Message); mails.Close(); }