<script>
function sendMail() {
debugger;
var link = 'mailto:Example@gmail.com'
+ document.getElementById('Email').value
+ '&body=' + document.getElementById('Email').value;
window.location.href = link;
}
</script>
以上代码是我的发送功能
<form>
<div class="input-main">
<span class="glyphicon glyphicon-user" aria-hidden="true"> </span>
<input type="text" value="Name" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Name';}">
</div>
<div class="input-main">
<span class="glyphicon glyphicon-envelope" aria-hidden="true"></span>
<input type="text" value="Email" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Email';}">
</div>
<div class="input-main">
<span class="glyphicon glyphicon-phone" aria-hidden="true"></span>
<input type="text" value="Phone" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Phone';}">
</div>
<textarea onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Messages';}">Messages</textarea>
<input type="submit"id="Email" onclick="sendMail()" value="Send">
</form>
这可能是code.I我正在使用JavaScript和html发送的三件事......在上面的程序中
我尝试使用JavaScript为移动应用程序发送邮件,但它不起作用。请建议一些解决方案。
答案 0 :(得分:1)
请试试这个。 https://github.com/dwyl/html-form-send-email-via-google-script-without-server
使用googlescript