public static void GetTraderMessages() { try { List <OpenPop.Mime.Message> messages = FetchAllTraderMessages(hostname, port, useSsl, username, password); for (int i = messages.Count - 1; i >= 0; i--) { OpenPop.Mime.MessagePart xml = messages[i].FindFirstPlainTextVersion(); if (xml != null) { string xmlString = xml.GetBodyAsText(); System.Xml.XmlDocument doc = new System.Xml.XmlDocument(); doc.LoadXml(xmlString); doc.Save("test.xml"); } ProcessCycleTraderEmail readXML = new ProcessCycleTraderEmail(); readXML.ParseProspect("test.xml"); DeleteMessage(i + 1); } Console.Write("Processing complete."); Console.Read(); } catch (Exception) { throw; } }
public static void GetTraderMessages() { try { List <OpenPop.Mime.Message> messages = FetchAllTraderMessages(hostname, port, useSsl, username, password); for (int i = messages.Count - 1; i >= 0; i--) { OpenPop.Mime.MessagePart xml = messages[i].FindFirstPlainTextVersion(); if (xml != null) { string xmlString = xml.GetBodyAsText(); System.Xml.XmlDocument doc = new System.Xml.XmlDocument(); doc.LoadXml(xmlString); doc.Save("c:\\openpop\\test.xml"); // } removed by jim // as a non xml email ending up in mailstop would trigger //a duplicate send of the last message on disk. ProcessCycleTraderEmail readXML = new ProcessCycleTraderEmail(); try { readXML.ParseProspect("c:\\openpop\\test.xml"); } catch (Exception) { } DeleteMessage(i + 1); } //added by jim } Console.Write("Processing complete."); System.Threading.Thread.Sleep(10000); // Console.Read(); Environment.Exit(0); } catch (Exception) { throw; } }