We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Msg as an attach item to gmail not using exchange smtp server to send

Attach msg as an item and sending the message to gmail and not using Exchange SMTP Server.

Then the message is not readable. The gmail only see Winmail.dat.

But in the same copy that go to email exchange email is ok.

Below is the code

<%@ Import namespace=“Aspose.Email” %>
<%@ Import namespace=“Aspose.Email.Mapi” %>
<%@ Import namespace=“Aspose.Email.Clients.Smtp” %>
<%@ Import namespace=“System.IO” %>

Dim eMailLicense As New Aspose.eMail.License()

Dim vDataDir as String = “D:\Website\TestAspose”

Dim MailMsg as MailMessage = new MailMessage()

MailMsg.From = “xxxxx@abc.com.au”

MailMsg.To = “xxxyyy2000@gmail.com
MailMsg.Subject = “This is test message”
MailMsg.Body = “This is test body”
MailMsg.HtmlBody = “This is test body

Dim msg as MapiMessage

msg = MapiMessage.FromMailMessage(MailMsg)

Dim attachMsg as MapiMessage = MapiMessage.FromFile(vDataDir & “test.msg”)
msg.Attachments.Add(“test1.msg”, attachMsg)

Dim attachFaxMsg as MapiMessage = MapiMessage.FromFile(vDataDir & “testFax.msg”)
msg.Attachments.Add(“test2.msg”, attachFaxMsg)

'msg.Save(vdataDir + “testWithMsg.msg”)
'Dim Stream As MemoryStream = New System.IO.MemoryStream()

Dim options as new MailConversionOptions()
options.ConvertAsTnef = true
Dim Message as MailMessage = msg.ToMailMessage(options)

Dim smtp as new SmtpClient()
smtp.Host = “” ’ Local IIS smtp server, This smtp will cause sending to gmail with msg as attachment and make gmail is not readable

'smtp.host = “smtp.coverforce.com.au” ’ Exchange SMTP server , Send by Exchange smtp then it is OK. We use the latest aspose email net ver 20.11




Can you please share the source file and generated preview with us reproducing the issue on your end. I am assuming that you are already using latest Aspose.Email for .NET version on your end.

I am using the latest dll. and any msg file will cause the problem as long as the email send to is gmail and the smtp used to send is not exchange server then the body message is not readable including the attachment


As requested earlier can you please share the source MSG file and generated preview in Gmail with us so that we may try reproducing and then log it in our issue tracking system.


Attached is the msg and the gmail preview. I notice that the problem is still there if we rem out the below 2 lines (Without attaching the msg)

msg.Attachments.Add(“test1.msg”, attachMsg)
msg.Attachments.Add(“test2.msg”, attachFaxMsg)

testFax.zip (71.8 KB)

Gmail preview
image.png (7.1 KB)


I have created an issue with ID EMAILNET-39991 in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once the issue will be fixed.