Exception occurs calling GetAttachments function for specific email using .NET

Calling GetAttachments function for the attached email results in the following exception:

Not null and not empty empty string is expected.
Parameter name: fileName

Unzustellbar_ overdue v2.zip (4.1 KB)

Viewing the eml file in Outlook works fine.
The problem can be easily reproduce using GroupDocs.Viewer 20.5 with this code:

try
{
    using (var viewer = new GroupDocs.Viewer.Viewer("Unzustellbar_ overdue v2.eml"))
    {
        viewer.GetAttachments();
    }
}
catch (Exception ex)
{
    Console.WriteLine(ex.Message);
}
1 Like

@Clemens_Pestuka

We’re investigating this issue. Your investigation ticket ID is VIEWERNET-2532. As there’s any update, you’ll be notified.

1 Like

@Clemens_Pestuka

Your reported issue VIEWERNET-2532 is now fixed in API version 20.6.

1 Like

@atirtahir3

Thanks a lot for the reply and the fix!
Unfortunately I also found another problem :confused:

When I modify the code to print the file extensions, it will only display one of the two .txt files.

            var attachments = viewer.GetAttachments();
            foreach (var a in attachments)
                Console.WriteLine(a.FileType.FileFormat);

this will print “Plain Text File” and “Unknown”, but when opening the .eml both files are just text files.
image.png (26.4 KB)
But I do agree that there is something strange with this filename, as it changes every time that I open the email.
As our conversion code also converts all attachments one-by-one, it would be great if the extension could be determined by GroupDocs. (as GroupDocs conversion will fail if the attachment does not have an extension)

1 Like

@Clemens_Pestuka

We tried to reproduce this issue using a sample EML file (that has 2 text, 1 PDF and 1 PNG files as attachments) , please have a look at this output.JPG (15.1 KB).
Can you please share your problematic EML file?

@atirtahir3

Sorry, I should have mentioned that it only happens with the file from this thread.
I’ll upload it again just in case.
Unzustellbar_ overdue v2.zip (4.1 KB)

@Clemens_Pestuka

We’ve reproduced this behavior at our end as well. This issue is now under investigation with ticket ID VIEWERNET-2574. You’ll be notified in case of any update.

1 Like

@Clemens_Pestuka

We have an update on VIEWERNET-2574. It happens because the attached file doesn’t have a name so Outlook creates the name as “Untitled attachment …”. The fix will be included in version 20.7 that is planned at the end of July.

1 Like

@atirtahir3

Perfect :smile: Thanks a lot!

1 Like

@Clemens_Pestuka

You’re welcome :slight_smile:

1 Like

The issues you have found earlier (filed as VIEWERNET-2574) have been fixed in this update. This message was posted using Bugs notification tool by atirtahir3