Loading file stream in MailMessage is taking long time

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

@msingh02,

We were able to reproduce your issue and have logged a ticket in our issue tracking system as EMAILNET-39096 to look at your specific scenario. We will update you here as soon as we have additional information.

1 Like

The issues you have found earlier (filed as EMAILNET-39096) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by MuzammilKhan