0

In my checkout page iam using
to take the screenshot of that page and i need to send this screenshot to mail of the user.

<button onclick="canvas();">Confirm order</button>

and script is:

function canvas(){
    html2canvas(document.body, {
        onrendered: function(canvas) {
            document.body.appendChild(canvas);
        },
        width: 1200,
        height: 700
    }
)}; 

By using this image of the particular page is showing, but i need to send that particular image to mail of the user. How can i send that image in php code....

<?php
     $Name = $_POST['Name'];
     $phone= $_POST['phone'];
     $formcontent= 
                  "Name: $Name \n
                  Contact Number: $phone";

     $recipient = "info@domain.com";
     $subject = "xxxx";
     $headers = 'From: '.$Name."\r\n".
     'Cc: '.$Email."\r\n";
     mail($recipient, $subject, $formcontent, $headers) or die("Error!");
?>

Can i give an id called $canvas in php code to send email. Pls give me suggestion.

Pankaj K
  • 760
  • 7
  • 19
sandy
  • 31
  • 1
  • 4
  • 1
    http://stackoverflow.com/questions/12301358/send-attachments-with-php-mail – shellakkshellu Jul 03 '15 at 05:43
  • I need to send it as jpg image. I can't save that image with particular name as so many users visiting that page. – sandy Jul 03 '15 at 06:19
  • First you should make an ajax request to save the image file with any name and then setup your mail script to send the file along with the contents – shellakkshellu Jul 03 '15 at 06:49

0 Answers0