static void Main(string[] args) { const string filePath = "ImageTestDownload.msg"; IMail msg; using (var converter = new MsgConverter(filePath)) { msg = converter.CreateMessage(); } Console.WriteLine(msg.Subject); Console.ReadLine(); }
public void readEmail() { using (MsgConverter converter = new MsgConverter(@"C:\Users\pramo_gsxqos1\Desktop\sample.msg")) { if (converter.Type == MsgType.Note) { IMail email = converter.CreateMessage(); Console.WriteLine("Subject: {0}", email.Subject); Console.WriteLine("Sender name: {0}", email.Sender.Name); Console.WriteLine("Sender address: {0}", email.Sender.Address); Console.WriteLine("Attachments: {0}", email.Attachments.Count); } } }
public void readEmail() { using (MsgConverter converter = new MsgConverter(@"C:\Users\pramo_gsxqos1\Desktop\sample.msg")) { if (converter.Type == MsgType.Note) { IMail email = converter.CreateMessage(); Console.WriteLine("Subject: {0}", email.Subject); Console.WriteLine("Sender name: {0}", email.Sender.Name); Console.WriteLine("Sender address: {0}", email.Sender.Address); string Mailbody = email.GetBodyAsText(); getKeyPhrases(Mailbody); } } }
public static List <RecognitionDetails> Upload() { List <RecognitionDetails> _recognitionDetailsList = new List <RecognitionDetails>(); string[] files = Directory.GetFiles(System.AppDomain.CurrentDomain.BaseDirectory + "uploads\\"); for (int i = 0; i < files.Length; i++) { string fname = files[i];//System.AppDomain.CurrentDomain.BaseDirectory + "uploads\\" + filenames[0]; using (MsgConverter converter = new MsgConverter(fname)) { if (converter.Type == MsgType.Note) { IMail email = converter.CreateMessage(); Console.WriteLine("Subject: {0}", email.Subject); Console.WriteLine("Sender name: {0}", email.Sender.Name); Console.WriteLine("Sender address: {0}", email.Sender.Address); string Mailbody = email.GetBodyAsText(); string _keyphrases = getKeyPhrases(Mailbody); string _cclist = getCCList(email); string _project = GetProjectsList(Mailbody); _recognitionDetailsList.Add( new RecognitionDetails { Nominatedby = "Sunitha", Project = _project, KeyPhrases = _keyphrases, Year = "2020", Content = Mailbody, TaggingList = _cclist }); } } } return(_recognitionDetailsList); }
private static void ReadAllEmails() { ProcessFile processFile = new ProcessFile(); //Pattern 1 foreach (string file in Directory.EnumerateFiles(@"C:\Users\g.griffo\Documents\Projects\Private\TripDashboard\emails\", "*Confirmado*.msg")) { using MsgConverter converter = new MsgConverter(file); if (converter.Type == MsgType.Note) { IMail email = converter.CreateMessage(); string msgAsText = email.GetBodyAsText(); AddTrips(processFile.ProcessPortugueseFilePattern1(msgAsText)); } } ////Pattern2 foreach (string file in Directory.EnumerateFiles(@"C:\Users\g.griffo\Documents\Projects\Private\TripDashboard\emails\", "*Confirmação da reserva *.msg")) { using MsgConverter converter = new MsgConverter(file); if (converter.Type == MsgType.Note) { IMail email = converter.CreateMessage(); string msgAsText = email.GetBodyAsText(); AddTrips(processFile.ProcessPortugueseFilePattern2(msgAsText, file)); } } //Booking Confirmation foreach (string file in Directory.EnumerateFiles(@"C:\Users\g.griffo\Documents\Projects\Private\TripDashboard\emails\", "*Booking Confirmation*.msg")) { using MsgConverter converter = new MsgConverter(file); if (converter.Type == MsgType.Note) { IMail email = converter.CreateMessage(); string msgAsText = email.GetBodyAsText(); AddTrips(processFile.ProcessEnglishFilePattern1(msgAsText, file)); } } trips.Sort(delegate(Trip p1, Trip p2) { return(p1.Departure.CompareTo(p2.Departure)); }); //before your loop var csv = new StringBuilder(); foreach (Trip trip in trips) { csv.AppendLine(trip.ToString()); } //after your loop File.WriteAllText(@"C:\Users\g.griffo\Documents\Projects\Private\TripDashboard\Trips.csv", csv.ToString()); }
private static List <RecognitionDetails> BindRecognitionDetails() { List <RecognitionDetails> _lrecognitionDetails = new List <RecognitionDetails>(); RecognitionDetails _recognitionDetails = new RecognitionDetails(); _recognitionDetails.Content = "Thank you for all your hard work and efforts on PHT. You are doing a great job and thank you"; _recognitionDetails.Project = "PHT"; _recognitionDetails.KeyPhrases = "hard work / great job"; _recognitionDetails.Nominatedby = "Sunitha Rani"; _recognitionDetails.TaggingList = "pramod"; _recognitionDetails.Year = "2019"; _lrecognitionDetails.Add(_recognitionDetails); RecognitionDetails _recognitionDetails2 = new RecognitionDetails(); _recognitionDetails2.Content = "Mohit has gone above and beyond to provide the best client service possible. The client service we have provided as Deloitte would not be possible without his contribution. Your high quality delivery with in a short duration of time for GPD release has been Appreciated by the client."; _recognitionDetails2.Project = "GDP"; _recognitionDetails2.KeyPhrases = "best client service possible / high quality delivery / short duration of time"; _recognitionDetails2.Nominatedby = "Sunitha Rani"; _recognitionDetails2.TaggingList = "[email protected]/[email protected]/[email protected]"; _recognitionDetails2.Year = "2020"; _lrecognitionDetails.Add(_recognitionDetails2); RecognitionDetails _recognitionDetails3 = new RecognitionDetails(); _recognitionDetails3.Content = "Josh had a number of things that unfortunately hit all at once. He worked through everything in a professional manner. I want to recognize the quality and amount of work he did in that intense time. He not only led a DSTART scuccessfully but went above and beyond in his research, development of a pre-read, and virtual facilitation of a convening with national experts in immunization and race, she has stayed committed in a meaningful way, helping orient new teams to the topic and leading proposals. The impact of the work she produced had on the client positioned us for significant follow-on (e.g., from $95K in work to a new $1M+ contract)."; _recognitionDetails3.Project = "DSTART"; _recognitionDetails3.KeyPhrases = "professional manner / intense time / pre-read / virtual facilitation / national experts / meaningful way / orient new teams / significant follow-on / orient new teams "; _recognitionDetails3.Nominatedby = "Ganesh Subramainan"; _recognitionDetails3.TaggingList = "[email protected]/[email protected]/[email protected]"; _recognitionDetails3.Year = "2020"; _lrecognitionDetails.Add(_recognitionDetails3); RecognitionDetails _recognitionDetails4 = new RecognitionDetails(); _recognitionDetails4.Content = "Reward for outstanding service at a global S/4 HANA transformation, driving change and adoption for multiple workstreams in a highly-complex environment during a long-term assignment. also preventing escalation at FA when the client wasn't able to use templates to rationalize their item and vendor masters. David's hard work can be taken for granted as he quietly balances the client need with our teams capabilities. While our client should be taking ownership of our solution, it still falls to David to cover the areas they still have not taken on. In addition, David must work continuously with our team to help them achieve the quality that they are capable of."; _recognitionDetails4.Project = "global S/4 HANA "; _recognitionDetails4.KeyPhrases = "outstanding service / global S / multiple workstreams / complex environment / long-term assignment / David's hard work "; _recognitionDetails4.Nominatedby = "Sampath"; _recognitionDetails4.TaggingList = "[email protected]/[email protected]/[email protected]"; _recognitionDetails4.Year = "2020"; _lrecognitionDetails.Add(_recognitionDetails4); RecognitionDetails _recognitionDetails5 = new RecognitionDetails(); _recognitionDetails5.Content = "Wick has been delivering solid work on the engagement. More importantly, he is demonstrating her commitment to the success of this important contract on a daily basis and can always be relied upon. Wick’s work ethic is exemplary. He never balks at taking on challenging tasks or learning new skills. He routinely challenges himself to ratchet up his efficiencies and improve the quality of his work in TOD. Not only TOD he was successfully leading PHT also. The ownership he exhibits in consistently going above and beyond to bring in deliverables on or ahead of schedule is an inspiration to his team members. He is always willing to share his knowledge and collaborate with his team. "; _recognitionDetails5.Project = "TOD / PHT"; _recognitionDetails5.KeyPhrases = "solid work / important contract / daily basis / new skills "; _recognitionDetails5.Nominatedby = "Sampath"; _recognitionDetails5.TaggingList = "[email protected]/[email protected]/[email protected]"; _recognitionDetails5.Year = "2020"; _lrecognitionDetails.Add(_recognitionDetails5); string[] files = Directory.GetFiles(System.AppDomain.CurrentDomain.BaseDirectory + "uploads\\"); if (files.Length > 0) { for (int i = 0; i < files.Length; i++) { string fname = files[i];//System.AppDomain.CurrentDomain.BaseDirectory + "uploads\\" + filenames[0]; using (MsgConverter converter = new MsgConverter(fname)) { if (converter.Type == MsgType.Note) { IMail email = converter.CreateMessage(); Console.WriteLine("Subject: {0}", email.Subject); Console.WriteLine("Sender name: {0}", email.Sender.Name); Console.WriteLine("Sender address: {0}", email.Sender.Address); string Mailbody = email.GetBodyAsText(); string _keyphrases = getKeyPhrases(Mailbody); string _cclist = getCCList(email); string _project = GetProjectsList(Mailbody); _lrecognitionDetails.Add( new RecognitionDetails { Nominatedby = "Sunitha", Project = _project, KeyPhrases = _keyphrases, Year = "2020", Content = Mailbody, TaggingList = _cclist }); } } } } return(_lrecognitionDetails); }