0
   <form action="Gmailto:fictionalgmail@gmail.com" method="post" enctype="text/plain">
        <label>Your Name:</label>
        <input type="text" name="YourName" value=""><br>
        <label>Your Email:</label>
        <input type="email" name="YourEmail" value=""><br>
        <label>Your Message:</label> <br>
        <textarea name="Message" id="YourMessage" cols="31" rows="7"></textarea>
        <br><input type="submit">
    </form>

i tried channging the email, security and all that stuff

nudle
  • 9
  • 1
  • it's `mailto:..` not `gmailto:`, and which email client opens depends on the user's settings, you can only call for opening a mail client, it can be gmail or whatever the user has set on their system. – Deepak Kamat Dec 26 '22 at 09:26

3 Answers3

2

The mailto: url scheme is a generic email scheme, not one specific to GMail. There isn't a URL scheme specific to GMail. There is no g at the front of it.

The browser needs to know about the email client you are using for them to work, and since GMail is a web app and not local software, it can't register itself at the OS level, so end users need to configure their browser to use mailto URLs with GMail.

mailto: URLs are notoriously unreliable as the value of a form action so you should avoid them anyway.


If you want to handle form data, then use server side programming. It's much more reliable and gives you control over the UX.

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

The only thing that needs to be fixed in your code is 'Gmailto' There is nothing as Gmailto in html. Instead you have to select 'mailto'. So that when you click submit you will be redirected to your computer's emailing software as you requested. From there you can select your gmail account to continue.

-1

You have a typo in the action, it's mailto:, not Gmailto:

Your overall code is correct, except for where you are doing a POST request, email clients will often expect certain format of query parameter which is done by using GET method. Check this for reference - https://stackoverflow.com/a/21046049/1391805

Deepak Kamat
  • 1,880
  • 4
  • 23
  • 38
  • Using a POST with enctype text/plain is the usual way to handle form data with the mailto scheme. The answer you reference is about a link, not a form. – Quentin Dec 26 '22 at 09:32