XavierusWolf
XavierusWolf

Reputation: 129

Sending files through email - multipart

I want to make a HTML document that allows the user to send files through email. I've read I have to use the "multipart/form-data".

<HTML>
<HEAD>
<TITLE>File test</TITLE>
</HEAD>
<BODY>

<FORM ACTION="mailto:[email protected]" METHOD="POST" ENCTYPE="multipart/form-data">
Send a file
<BR><INPUT NAME="File" TYPE="file">
<BR><INPUT TYPE="submit" VALUE="Send">
</FORM>
</BODY>
</HTML>

This is a simple example that I cannot fix. What am I missing?

Edit: The problem is that I receive the email without any content.

Upvotes: 0

Views: 858

Answers (2)

Quentin
Quentin

Reputation: 943100

The mailto: URI scheme, when used for form actions, requires a combination of a compatible browser and email client. These are not so common as to be practical for use on the WWW (see also The Mythical Mailto:).

I'm not aware of any combination that supports file attachments via that scheme.

You need to use an HTTP (or HTTPS) URI with a server side form handler.

Upvotes: 1

Vicky
Vicky

Reputation: 11

Mail will be sent successfully with your default mail client that is set-up in your machine. Make sure you have default mail client set-up. Eg: Outlook Express, Office Outlook.

Upvotes: 0

Related Questions