Hi Team,
We are loading a file stream to the MailMessage Object which is taking too long.
Please refer below code:
static void Main(string[] args)
{
string filename = @"C:\Test\TestFile.txt";
FileStream fileStream = new FileStream(filename, FileMode.Open, FileAccess.Read);
var mailMessage = MailMessage.Load(fileStream, new MhtmlLoadOptions());
Console.WriteLine("Loading File stream to MailMessage");
//Taking around 8-9 seconds.
}
Is there a way to minimize this delay? We are using this statement a couple of times for one of the processes in our application which is making our application slow when loading multiple files.
Note: I have attached the TestFile.txt in TestFile.zip.
TestFile.zip (249.5 KB)
Thanks,
Monika