-2

I've created a simple contact form with inputs like name, phone number.. And a file import (in order to add an attachment to the mail).

All the informations are shown in the mail except the imported file.

How to make it works please ??

a{
  text-decoration:none;
  display:inline-block;
  background-color: rgb(255,194,0);
  padding:10px;
  color:#FFF;
  width:50px;
  text-align:center;
  cursor:pointer;
}
a:hover{
  opacity:0.5;
}
<label>
add a file :
</label>
<input class="btn_import" type ="file"/>
<a href="mailto:http://mywebsite.com?subject=just to see the attachment file&attachment="the file here"">send</a>
Sushi
  • 646
  • 1
  • 13
  • 31
  • 1
    You should [learn how to use the label element properly](http://www.456bereastreet.com/archive/200711/use_the_label_element_to_make_your_html_forms_accessible/). Without a for attribute or a form control inside it, a label is useless. – Quentin Jan 19 '16 at 14:14

1 Answers1

1

There is no way to add attachments using the mailto: URL scheme.

Use a real form. Submit it to a server side program. Have the server side program send the email.

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335