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();
}