Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 376
  • Last Modified:

form action:mailto & attachments

Hi ...

I have two questions:

1. How secure and reliable is the method of placing attachments using the form action mailto:? If so, an answer to question 2 would be helpful. If not, other suggestions would be great.

2.What is missing from this code, as I cannot get the data into an email with an attachment.

<form method="post" action="mailto:myname@something.com" enctype="multipart/form-data">
<input type="file" name="attachedimage2" id="attachedimage2" size="40" accept="image/*" style="color: #010425; background-color: #e6e6e6; border-color: #666600; border-color: #b8860b; font-family: verdana; font-size: 10pt" />

1 Solution
1. It is not so much insecure as impossible - and rightly so since if it was possible, it would be insecure.

2. Same problem! If you could set the value of an input type="file" rather than the user selecting a file then that would be insecure so it is impossible.

What file are you trying to get a user to email?
  Don't bother trying this in a web context because if you can, you would have found a security hole that should be fixed.

Or do you want to email a file on the web server to the user?
You will need server side code such as ASP using CDO to achieve this.
(1) Very secure - the file would never leave the users computer. mailto: is horribly unreliable at the best of times, I've never seen it work with file attachments. If it did work (or if you used another method) it would be as secure as email normally is (i.e. not so secure that you would want to send credit card details by it).

(2) A form handler that can actually cope with file attachments.


should give you pointers.
pjbyrneAuthor Commented:
Thanks. I will look into server side code and the form handler links.

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now