I have a code that generates a PDF file and I want to send it as an attachment in an email.
I have this code:
FileContentResult fileContentResult = File(fileName, "application/pdf", "file.pdf");
and I have this code to send an attachment
Attachment a = new Attachment();
sender.SendMail("a@a.com", "a@a.com", "subject", "Body", a);
How do I convert a FileContentResult to an Attachment ?
leora source
share