Hello,
I am using the latest versions of Aspose.Network (4.1.0.0) and Aspose.Pdf (3.7.0.0). I am attempting to attach a Pdf document to a mail message using a MemoryStream object. The email sends and arrives just fine, but the attachment will not open. Adobe Reader tells me that the Pdf is corrupted. Here's what I am doing.
Dim myPdf as New Aspose.Pdf.Pdf
generatePdf(myPdf) 'Passed ByRef
Dim ms As New System.IO.MemoryStream
myPdf.Save(ms)
Dim message as New Aspose.Network.Mail.MailMessage
message.From.Add("from email")
message.To.Add("to email")
message.Subject = "MemoryStream Attachment"
message.HtmlBody = "
Here is the file.
"message.AddAttachment(New Aspose.Mail.Attachment(ms))
Dim smtp As New Aspose.Mail.SmtpClient("my host")
smtp.AuthenticationMethod = Aspose.Mail.SmtpAuthentication.None
smtp.Send(message)
If I save the Pdf to file and then attach the file, the Pdf is not corrupted. Please fix this ASAP, I have a client waiting on this.
Thank you!
Dan