开发者

Link to open email client and attach file?

No开发者_如何学Got sure if this relates more to PHP or Javascript/jQuery, but is there a way to attach a file to an email client (i.e Outlook), when user click on a link/button?

I have a link that generates a PDF and I want it so that, when someone click on a link, it will open up their email client with the PDF already attached, and subject already fill in.

I know, you can use <a href="mailto:..." but that only opens up the mail client. I also need to attach a file with a subject fill in.

Is this doable with PHP or Javascript?


You can set the subject line in the mailto with

<a href="mailto:someone@gmail.com?subject=Sample%20subject">MAIL TO EXAMPLE</a>

setting an attachment is not that easy and you would be better off providing people with a button that will trigger php to send the email (as per ott's comment). In theory some email clients will support adding "attachment=path/to/file.txt" attribute but I have never seen it work

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜