0

I have emails in DB, and i want to save them as *.eml files.

SmtpClient Client = new SmtpClient();
Client.DeliveryMethod = SmtpDeliveryMethod.SpecifiedPickupDirectory;
Client.PickupDirectoryLocation = @"c:\aaa\import";
MailMessage Message = new MailMessage();
...
Client.Send(Message);

This works, but it replace the Date header to the present date and time. How can i define custom dates and times?

I found this, but it is not free.

Ken White
  • 123,280
  • 14
  • 225
  • 444
trob
  • 147
  • 9

1 Answers1

0

You are halfway there since you specify PickupDirectory.

Specify a different directory.

After saving, open up the file in your code and change the date and time.

Then move file to the PickupDirectory specified in your IIS SMTP settings.

ridoy
  • 6,274
  • 2
  • 29
  • 60
MikeLim
  • 1,189
  • 1
  • 9
  • 11