I try to create an MSG file with your sample:
' Create an instance of MailMessage class
Dim mailMsg As MailMessage = New MailMessage
' Set from, to, subject and body properties
mailMsg.From = txtFrom.Text
mailMsg.To = txtTo.Text
mailMsg.Subject = txtSubject.Text
mailMsg.TextBody = txtBody.Text
' Create an instance of MapiMessage class and pass MailMessage as argument
Dim outlookMsg As MapiMessage = MapiMessage.FromMailMessage(mailMsg)
' Path and file name where message file will be saved
Dim strMsgFile As String = "c:\temp\sample.msg"
I get an error on From and To properties, a MailAddressCollection object is required.
I did it and it's working fine but i need to add a Display Name for my email address:
SMITH John
john.smith@company.com
MailAddress.DisplayName is readonly...
How i can do that?
' save the message (msg) file
outlookMsg.Save(strMsgFile)
This message was posted using Page2Forum from Creating/Saving Outlook Message (msg) Files - Aspose.Network for .NET