我尝试使用JavaScript发送移动应用程序的邮件,但它不起作用

时间:2016-02-13 07:54:32

标签: javascript html cordova

<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发送的三件事......在上面的程序中

  1. 名称
  2. 电子邮件
  3. 电话号码
  4. 我尝试使用JavaScript为移动应用程序发送邮件,但它不起作用。请建议一些解决方案。

1 个答案:

答案 0 :(得分:1)

相关问题