Hi Team.
I am creating the .msg
file using the Aspose.Email library. A sample file is attached to this email.
I encountered the error message below while attempting to send this email file. Could you please look into this issue?
[image] [image] [image]
If we can successfully send the email using the new Outlook version, we are planning to purchase the Aspose.Email license.
Note: We can send emails using a different version of Outlook.
[image] [image]
Thank you for your assistance.
txtSubject.Text(Aspose.Email Evaluation).zip (51.1 KB)
Outlookversion.docx (165.2 KB)
Hello @ashokdar15,
Welcome to the Aspose.Email support forum!
Could you please provide a sample code snippet that you are using to create the message for sending?
Thank you.
Dim workDir As String = g_DocAccess.WorkingFolder
Dim msgFilePath As String = Path.Combine(workDir,"EmailWithAttachment.msg")
Dim mailMsg As New MailMessage()
mailMsg.From = New MailAddress("ashokmdarade@gmail.com")
mailMsg.To.Add("ashokmdarade@gmail.com")
mailMsg.Subject = "txtSubject.Text"
mailMsg.Body = "txtBody.Text"
mailMsg.Attachments.Add(New Attachment("D:\Quote93985.pdf"))
Dim outlookMsg As MapiMessage = MapiMessage.FromMailMessage(mailMsg)
outlookMsg.Save(msgFilePath, SaveOptions.DefaultMsgUnicode)
Hello @ashokdar15,
We have opened the investigation ticket in our internal issue tracking system:
Issue ID(s): EMAILNET-41382
Thank you.
Hi,
Is there any update on the above issue?
Hello @ashokdar15 ,
Your issue will be resolved this week.
Thank you for your patience.
Hi,
Is there any update on the above issue?
Hello @ashokdar15 ,
Yes, our developers have investigated the issue and came to the following conclusion:
It seems that the new version of Outlook doesn’t allow sending emails in the MSG format.
You can check it for yourself:
- create an email in the old Outlook
- save it in MSG format
- open the saved MSG file in the new Outlook, and try to send the email
The result will be the same. Only EML files can be successfully sent in the new Outlook.
You can save the message in EML format to send it with the new Outlook.
Sub Main()
’ Create a new MailMessage object
Dim message As New MailMessage()
' Set the subject and body
message.Subject = "Test Subject"
message.IsBodyHtml = True
message.Body = "Dear Customer, <br/><br/>We are pleased to inform you that your request has been processed successfully. Please find the attached document for further details regarding the quote. As a reminder, we ensure that all customer requests are handled with utmost priority. If you have any additional questions or concerns, feel free to reach out to our customer service at your earliest convenience.<br/><br/>This is an automated message, please do not reply. For any queries, kindly contact us at support@mtnl.com.<br/><br/>Best Regards,<br/>MTNL Support Team<br/><br/>Note: The attached file contains sensitive information. Please review the document carefully and keep it safe for future reference.<br/><br/>Important: Make sure to verify the details mentioned in the document to avoid any discrepancies later. Thank you for choosing our service and trusting us with your requirements.<br/><br/>We look forward to serving you better in the future!"
' Add recipients
message.[To].Add("ashokmdarade@gmail.com")
message.CC.Add("ashokmdarade@gmail.com")
' Specify the file to be attached
Dim attachmentPath As String = "D:\CRD Quote 93985.pdf"
Dim attachment As New Attachment(attachmentPath)
message.Attachments.Add(attachment)
' Save the message to .msg and .eml formats using Aspose.Email
Dim emlSaveOptions As New EmlSaveOptions(MailMessageSaveType.EmlFormat)
message.Save("D:\AsposeEmailMessageEML.eml", emlSaveOptions)
'Dim msgSaveOptions As New MsgSaveOptions(MailMessageSaveType.OutlookMessageFormatUnicode)
'message.Save("D:\AsposeEmailMessageMSG.msg", msgSaveOptions)
End Sub
I created the EML file using the above code.
But when I open it in the new Outlook body in the mail is missing.
image.png (35.6 KB)
I have Microsoft Outlook Version 1.2024.829.100 (Production).
@ashokdar15 ,
Please let us explore your case, and we will respond to you shortly.
@ashokdar15,
Using the HtmlBody
property and wrapping the content with the proper HTML structure (<html><body></body></html>
) ensures that the email is correctly formatted as HTML. Here’s the corrected example for setting up the email message body in Aspose.Email:
var message = new MailMessage
{
Subject = "Test Subject",
IsBodyHtml = true,
HtmlBody = @"<html><body>Dear Customer, <br/><br/>We are pleased to inform you that your request has been processed successfully.
Please find the attached document for further details regarding the quote.
As a reminder, we ensure that all customer requests are handled with utmost priority.
If you have any additional questions or concerns, feel free to reach out to our customer service
at your earliest convenience.<br/><br/>This is an automated message, please do not reply. For any queries, kindly
contact us at support@mtnl.com.<br/><br/>Best Regards,<br/>MTNL Support Team<br/><br/>
Note: The attached file contains sensitive information. Please review the document carefully and keep it
safe for future reference.<br/><br/>Important: Make sure to verify the details mentioned in the document to avoid
any discrepancies later. Thank you for choosing our service and trusting us with your requirements.<br/><br/>We
look forward to serving you better in the future!</body></html>"
};
Using HtmlBody
and setting IsBodyHtml = true
, will ensure the email content is processed and displayed as proper HTML.