开发者

Attach File Through mailto URI

开发者 https://www.devze.com 2022-12-21 23:47 出处:网络
Is it possible to attach a file using \"mailto:\" redirect in javascript? Something like this: document.location = \"mailto:\"+recipient+\"?subject=\"+subject+\"&body=\"+msg+\"?attach=\"开发者_如

Is it possible to attach a file using "mailto:" redirect in javascript?

Something like this:

document.location = "mailto:"+recipient+"?subject="+subject+"&body="+msg+"?attach="开发者_如何学JAVA+"file1.zip";


No, you can not add an attachment to a message with the mailto: URL scheme.

mailto: only supports header values or text/plain content. See RFC 2368 for details.


You can create a custom email form, letting the user input a valid email-address if necessary and send this to the server. The server then can use a mail library to send an email including an attachment.

If you use PHP, you can easily do this using PHPMailer.

0

精彩评论

暂无评论...
验证码 换一张
取 消