Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Press button, start native email program with attachment (located on webserver)

I have tried all different versions of send email however I have not yet achieved the following:

Javascript (or HTML) button, when pressed, open native mail application with attachment. The attachment is located on the same server as the webpage ex.:

  • web: www.something.com
  • file: www.something.com/file.pdf

The solution should not include serverside scripting (ASP/PHP) I need a simple snippet to make this happen :) Any help would be greatly appreciated.

like image 527
Chizpa Avatar asked Dec 28 '11 15:12

Chizpa


1 Answers

There is no standardized way to do this, but some email clients accept:

a href="mailto:[email protected]?attachment=<your filepath>"

where would have to be something like "C://Inetpub/wwwroot/myfile.pdf"

However, it will only attach something from the client's machine. You can't attach a file from the web.

Another option would be to just include a link to the file in the body of your email, or instructions to the user on how to email their attachment.

like image 65
Rebecca Avatar answered Oct 17 '22 10:10

Rebecca