Sahal Zaman
Sahal Zaman

Reputation: 255

I'm trying to send mail in JavaScript for mobile Application but it doesn't work

<script>
    function sendMail() {
        debugger;
        var link = 'mailto:[email protected]'
        + document.getElementById('Email').value
        + '&body=' + document.getElementById('Email').value;
        window.location.href = link;
    }
</script>

The above code is my Function for sending

<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>

This may code.I am using JavaScript and html three things I sending... in above program

  1. Name
  2. Email
  3. phone Number

I'm trying to send mail in JavaScript for mobile Application but it doesn't work. please do suggest some solution.

Upvotes: 0

Views: 69

Answers (1)

Udaayipp
Udaayipp

Reputation: 104

Please try this. https://github.com/dwyl/html-form-send-email-via-google-script-without-server

by using googlescript

Upvotes: 1

Related Questions