In our web application development project, we need a feature that lets the users to email themselves an attachment (~1MB) which resides on the server.

I was considering two alternatives.

Upon clicking on the email button

  1. Download the attachment to local folder and attach it to a new email window in outlook. The flaw with this approach is that we are assuming user has Outlook installed on their machine. I am also doubtful if browsers others than IE support this feature of being able to open Outlook message and attach a file.

  2. Send the attachment from middleware code to the user using a programmatic API for sending email. The downside of this approach is that it doesn't give the flexibility to the user to use the out of the box Outlook features such as being able to add more recipients / cc / bcc, edit the message etc, though it is possible to let the user do the same by providing a UI which lets them do all that.

What would be the recommended approach to this requirement?

  • "email themselves an attachment" - Why not just let them download it?
    – Morons
    Apr 7, 2016 at 13:17
  • We do have a separate feature for download. We want to also let the users to be able to email the file as attachment. Apr 8, 2016 at 14:30

1 Answer 1



Make the "attachment" web-addressable from your server and give the users (senders and recipients) a URL from which to access it.

Launching an e-mail message in the user's choice of email client with a message body that contains text of your choosing (including the URL) is an HTML one-liner. (OK, probably more than one line, with all the encoded line breaks and spaces you'll need to use to make it legible and cross-browser compatible). Read up on the "mailto:" protocol.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.