I'm wondering if there's a way to attach a PDF file that was generated using jsPDF and email it in asp.net C#?
This is the code snippet I have in c#:
MailMessage message = new MailMessage(fromAddress, toAddress);
message.Subject = subject;
message.IsBodyHtml = true;
message.Body = StrContent.ToString();
//message.Attachments.Add(new Attachment("getDPF()"));
smtp.Send(message);
In addition, I am utilizing a JsPDF library in this manner:
<script type="text/javascript" src="jsPdf/jspdf.min.js"></script>
<script type="text/javascript">
function getPDF()
{
var doc = new jsPDF();
doc.text(20, 20, 'TEST Message');
doc.addPage();
//doc.save('volt.pdf');
}
</script>
Any ideas on how I can include the PDF attachment in the email before sending it off? Appreciate any help.