Free Support Forum -

Msg send internally will not convert to eml


Below code is used to convert .msg files to .eml files. This works fine, nothing wrong with this...

But, every now and then a System.NullRefferenceException error returns when converting a .msg file.

Attached a zip file with 2 .msg files. 1 converts 2 .eml fine with below function and the other doesn't.

I think I've found the difference between the two .msg files:

- one .msg is send externally (sending mail server is the same as the receiving server)

- one .msg is send internally (never ‘left’ the exchange server)

Are these findings correct and why does the MailMessage object have a problem with the internally send msg file?

How can I convert the internally send .msg file to .eml?

Public Function ConvertMsg2Eml(ByVal sMsgFileName As String) As Boolean

'Load mail message
Dim message As MailMessage = New MailMessage
message = MailMessage.Load(sMsgFileName, MessageFormat.Msg)
'Save to msg file
message.Save(Replace(sMsgFileName, ".msg", ".eml"), MailMessageSaveType.EmlFormat)
ConvertMsg2Eml = True
Catch ex As Exception
ConvertMsg2Eml = False
End Try

End Function
'-----end code-----

Hi Erik,

Thanks for writing to Aspose.Email support team.

I have analyzed the information and this issue is re-produced using your sample msg files here.

I also tried with some other sample messages as well, having similar nature i.e. sent from SMTP to Exchange and sent from Exchange to Exchange however this issue was not observed with these messages.

I have passed this whole information and sample messages to the development team, and will write back here as soon as some feedback is received from the development team.

This issue is logged in our issue tracking system as NETWORKNET-33613.

The issues you have found earlier (filed as NETWORKNET-33613) have been fixed in this update.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.