I wrote a C# client to download emails from my POP3 mailbox and forward them to my internal exchange server via SMTP.
The code below is working. But the time stamps and delivery time information from the original email are overwritten hence lost because this code will create a complete new email.
Is there any chance to forward emails without loosing the time stamp information from the original email?
using (SmtpClient smtp = new SmtpClient())
{
smtp.Connect(connectionServer["ExchangeServer"], 25);
try
{
smtp.Ehlo(connectionServer["ExchangeServer"] + "." +
connectionServer["ExchangeServerDomain"] + ".local");
}
catch
{
success = false;
smtp.Helo(connectionServer["ExchangeServer"] + "." +
connectionServer["ExchangeServerDomain"] + ".local");
}
smtp.MailFrom("");
smtp.RcptTo(popReceipient);
smtp.DataFromFile(path);
smtp.Disconnect();
}
It's not possible. Another option would be to use OpenPop.Net to send a separate email with the original email attached as a "*.eml" file that can be open with most email clients. I can post some code if this approach is useful for you.