I am creating pdf using jsPDF & Html2PDF . Pdf is generating perfectly and also pdf is downloaded and saved on my pc as I click on button. But I also want to send PDF in mail when i click on submit.
This is the code for generating the PDF
function generatePDF() {
// Choose the element id which you want to export.
$("#TitleHide_BE").attr("hidden", true);
var element = document.getElementById('content2');
element.style.width = '800px';
element.style.height = '1100px';
var opt = {
filename: 'invoice.pdf',
html2canvas: { scale: 1 },
jsPDF: { unit: 'in', format: 'A4', orientation: 'portrait', precision: '10' }
};
// choose the element and pass it to html2pdf() function and call the save() on it to save as pdf.
html2pdf().set(opt).from(element).save();
}
How can i send this pdf as a attachment in mail