Hi folks,
if there is other way then searching "SentItems"-Folder after sending the mail, how to find the correct mail (if two mails hav the same sender, recipients, subject and body texts.)
can you please tell me how to save a MailMessage to a msg-file after it has been sent.
(saved .msg file should contain the DateTime the mail was sent)
actually I am using the following code to construct a MailMessage
Code Snippet
- string exchangeServiceUrl = "http://myDomain/ews/exchange.asmx";
- IEWSClient exchange = EWSClient.GetEWSClient(exchangeServiceUrl, CredentialCache.DefaultNetworkCredentials);
- MailMessage beforeSent = newMailMessage();
- beforeSent.From = "TestAddress@myDomain.com";
- beforeSent.To.Add("TestAddress@myDomain.com");
- beforeSent.Subject = "TestMail";
- beforeSent.Body = "TestMail";
- exchange.Send(beforeSent);
- // And here is what I think whould be the best solution
- MailMessage afterSent = exchange.Send(beforeSent);
- afterSent.Save("C:\\EmailWithSentInfos.msg");
kind regards
Markus