简体   繁体   English

发送画布图像作为电子邮件附件

[英]Sending a Canvas Image as a E-Mail Attachment

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(); 我使用var image=canvas.toDataURL();将画布转换为图像var image=canvas.toDataURL();

I would like to attach it in the email client like outlook, directly without prompting user about save location. 我想将其直接附加到Outlook之类的电子邮件客户端中,而不会提示用户有关保存位置的信息。

Pleased if anybody can help me out. 很高兴有人可以帮助我。

Ideally when you are trying to send something, you need to use the mailto: tag. 理想情况下,当您尝试发送邮件时,需要使用mailto:标签。 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. 因此,我建议在邮件内容中提供一个指向文档路径的URL以解决该问题。

Sample mailto 邮件样本

mailto:xyz@gmail.com?subject=TestMail&body=This is a test mail

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM