How To Send Email from An ionic App without using email composer plugin?
<p>I am trying to send a E-Mail from my ionic app using Ajax call to my php code which i uploaded on my server.</p>

<p>Code for the Ajax call:</p>

<pre><code>$scope.forget = function(){

      $http({

        method: 'POST',

        url: 'server_name/mail.php',

        data: { mailTo: 'name@gmail.com', msg: 'hello!', sub: 'hey' }
      }).then(function successCallback(response) {

          alert(response.value+"msg sent!");
        },
        function errorCallback(response) {

          alert(response.value+"error with sending msg");
        });
    };
</code></pre>

<p>mail.php    </p>

<pre><code>&lt;?php 
    $_SERVER["PHP_SELF"];
    $to = $_POST["mailTo"];
    $txt = $_POST["msg"];
    $subject = $_POST["sub"];
    $headers = "From: emailadd@gmail.com";
    echo $subject;
    $flgchk = mail ($to, $subject, $txt, $headers); 

    echo $flgchk;
    if($flgchk){

      echo "&lt;script&gt;alert('Thank you for submiting your Details..!')&lt;/script&gt;";
     }
    else{

      echo "&lt;script&gt;alert('Error Occured Please Resend Details..!')&lt;/script&gt;"; 
    }

?&gt;
</code></pre>

<p>But i am not able to send the details .It is going into error call back response and shows error with sending msg. Can i anyone helpme with this ? or Is there any other method by which i can send an email oon button click?Thank you !</p>