简体   繁体   中英

Mailto is not loading the subject(or body);

I have been reading a lot of topics and trying for some time now and i can't seem to get my mailto: to fill in my subject and body.

So it starts the mail-client (i have tried 3 different clients(outlook,windows standard,gmail) and every time it fills in the mail-address but never the subject and body.

totalmenu() {
var form = document.getElementById('emailform');
// form.action = "mailto:" + personeel.email + "?subject=result&body=" 
//+ mail();
form.action = "mailto:blabla@gmail.com?Subject=result;
}

The comment shows the actual mailto i wanted to use. I made a new mailto with only a subject to check if it was object related but this is not working as well. any of u guys had similar problems or maybe see what i'm doing wrong here?

I build my own little test code, and probably found what the problem is. This code seems to work:

<html>
<body>
<form id="emailform" method="POST">
  <input type="text" value="this is a test">
  <input type="submit" value="send email">
</form>
<script>
(function() {
  var form = document.getElementById('emailform');
  form.action = "mailto:blabla@example.com?Subject=result";
})();
</script>
</body>
</html>

But if I change the form method from "POST" to "GET" it doesn't work anymore.

Are you using "GET" ?

I tested the code with Firefox and Chrome on Windows 10.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM