Hi,
I want to save a mailitem or mapimessage to a stream.
See my code:
Dim mailMsg As MailMessage = New MailMessage
mailMsg.From.Add(New MailAddress("from@company.com
"))
mailMsg.To.Add(New MailAddress("to@company.com
"))
mailMsg.Subject = “Subject”
mailMsg.HtmlBody = “Body”
Dim fStream As System.IO.Stream
mailMsg.Save(fStream, Aspose.Network.Mail.MessageFormat.Msg)
But I receive an error:
System.ArgumentNullException: Value cannot be null.
Parameter name: stream
at Aspose.Network.Outlook.MapiMessage.Save(Stream stream)
at Aspose.Network.Mail.MailMessage.Save(Stream stream, MessageFormat format)
I tried also with:
Dim outlookMsg As MapiMessage = MapiMessage.FromMailMessage(mailMsg)
outlookMsg.Save(fStream)
But I get the same error
Can you help me, please?