
        $(document).ready(function () {
            $("body").on('click', '.emailsale', sendEmail);
        
        function sendEmail() {
                var a = 0,
                email = $(".email").val(),
                vouchno = $(".vouchno").val(),
                pdfprn = $(".prnpdf").val();
        if (email != '' && vouchno != '') {
            $.ajax({
                url: pdfprn + '?vouchno=' + vouchno,
                success: function (data) {
                }
            });
            $.post('sendMail.php', {vouchno: vouchno, email: email}, function (data) {
                alert('Email Send to the Customer');
            });
        }
    }
});
    
