-1

enter image description hereI was currently working on my professional site that I purchased it template, there is a contact me form. I have tried different varies of editors and videos and some forums. I need some assistance. I Listed the code below. when I click the Send message button it opened the users email client, but the information in the form like name, email, subject, and message do not carry over. I have tried different things nothing works please help.

<i class="fa fa-paper-plane-o" aria-hidden="true"></i>

<div class="col l7 m7 s12">
   <form class="contact-form center-align" action="#">
      <input type="text" placeholder="Name">
      <input type="email" placeholder="Email">
      <input type="email" placeholder="Subject">
      <textarea id="textarea1" class="materialize-textarea" placeholder="Message"></textarea>
      <a href="mailto:email@domain.com?Name?Email?Subject?Message" class="custom-btn waves-effect waves-light">
          <i class="fa fa-paper-plane-o" aria-hidden="true"></i>
          send message
      </a>
   </form>
</div>here
  • 1
    Possible duplicate of [Can I set subject/content of email with using mailto:?](https://stackoverflow.com/questions/4782068/can-i-set-subject-content-of-email-with-using-mailto) – Turnip Aug 17 '17 at 09:13
  • Added a photo of the contact form on my site, which goes with the form code i provided in the post – Mark Mather Aug 17 '17 at 12:56

2 Answers2

0

the pattern should be: mailto:email followed by a question mark and then an ampersand list of parameter names and values.

E.G.

"mailto:mark.mather82@outlook.com?body=your email text&subject=your email subject"

I'm not sure what you're trying to achieve with the message and name parameters but these are invalid anyway so i have omitted them.

hairmot
  • 2,975
  • 1
  • 13
  • 26
  • like i said before in my initial post it was a template i purchased and the code was already, all i had to do was program the send message button but nothing was working right. i researched videos and read other forums wasnt getting the answer i need. – Mark Mather Aug 17 '17 at 12:32
0

You seems not to know what is the mailto link type, or at least how to use it.

The mailto link accept the following parameters :

  • mailto: the email recipiant address
  • cc: the carbon copy email address
  • bcc: the blind carbon copy email address
  • subject: the subject of your email
  • body: the content of your email

Your Name, Email and Message parameters are not valid parameters in HTML.

Also, about delimiters :

  • ? is the first parameter delimiter
  • & is the other parameters delimiter

Knowing all that, you can now pretty easily create your link :

<a href="mailto:mark.mather82@outlook.com?subject=Your%20Subject&body=The%20body%20of%20the%20email">

N.B: In order to have spaces in your Subject and Body, you must replace every spaces with %20

Here is a pretty clear and precise article about mailto links that I really recommend you to read, from which I get almost all the informations about mailto links.

Louis 'LYRO' Dupont
  • 1,052
  • 4
  • 15
  • 35