how to attach canvas image in a mailto link?

微笑、不失礼 提交于 2019-12-12 13:53:32

问题


I created a canvas image in my html page, and I want to create a mailto link, that when clicked on will open up the default email application (outlook for example) with the image of the canvas attached. Can this be done?

Thanks.


回答1:


No. It's not possible to do this with a "mailto:" link (that I suppose is what you are asking for), due that mailto: links do not support passing any kind of attachments (files, data, whatever), only text content (Subject, message... )

Check it here: RCF 2368

I think will be possible to do it sending the email from the server using a form, I mean send the canvas as DataURL to a PHP that could attach it to an email, and send that email with the attached file using PHPMailer Class. That's the only workaround I can figure out right now.

Greetz.
c:.




回答2:


Actually, you can easily create a "mailto" link to an image. (I think the first person misunderstood your question.)

The html looks like this. Just make sure to switch out the generic email and image info for yours.

 <a href="mailto:info@youremail.com">
  <img class="aligncenter" title="YOUR IMAGE TITLE" alt="Your ALT Image Title" src="http://www.example.com/image-file-location"/>
 </a>


来源:https://stackoverflow.com/questions/11112568/how-to-attach-canvas-image-in-a-mailto-link

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!