1

I want to send a Canvas as a attchment to an email on the click of a button.

I converted the canvas to an image using var image=canvas.toDataURL();

I would like to attach it in the email client like outlook, directly without prompting user about save location.

Pleased if anybody can help me out.

Hitesh
  • 277
  • 2
  • 4
  • 16
  • Related: http://stackoverflow.com/questions/11112321/how-to-save-canvas-as-png-image – Derek 朕會功夫 Mar 11 '13 at 07:13
  • @Derek i am able to save it on the client..but i would like to attach it in the email client like outlook, directly without prompting user about save location – Hitesh Mar 11 '13 at 07:23

1 Answers1

2

Ideally when you are trying to send something, you need to use the mailto: tag. This allows you to add a subject and body to the mail. This will not allow you to send an attachment though. So I would suggest giving a url to the path of the document in the content of the mail to solve the problem.

Sample mailto

mailto:xyz@gmail.com?subject=TestMail&body=This is a test mail
Shouvik
  • 11,350
  • 16
  • 58
  • 89
  • isn't there any way to send it as an inline image in body of email using php? – Hitesh Mar 11 '13 at 07:40
  • PHP is server side code. So incase you are send the mail from your back end then I guess, you need to look at other options on how the mail can be sent from your server. From the current context it looks like you are sending the email from client. So, currently it's not in the scope of JS. – Shouvik Mar 11 '13 at 07:43
  • Sorry @Hitesh, not much of a PHP guy. I would suggest putting up a new question with what you have tried and where you are getting stuck. The link provided by me does a fair bit of explanation, once you have unsuccessfully tried to replicate that, please add a new question with your issues. As the saying goes, "if you need a complete solution, hire someone to do it." – Shouvik Mar 11 '13 at 09:05