I have the error message as open pdf from email attachment. "Adobe Reader could not open 'filename.pdf' because it is either not a supported file type or because the file has been damaged (for example, it was sent as an email attachment amd was not correctly decoded"
My codes as below
byte content = Encoding.ASCII.GetBytes("
MemoryStream stream = new MemoryStream(content);
MemoryStream outStream = new MemoryStream();
var pdf = new Aspose.Pdf.Pdf();
mailMessage.Attachments.Add(new Attachment(outStream, "test.pdf"));
System.Net.Mail.SmtpClient client = new SmtpClient();
mailMessage.Body = "test";
mailMessage.Subject = "test";
How can I send email with pdf attachemnt?. I would not save pdf file to the file system before sending as attachment email.