6 Replies Latest reply on Sep 1, 2016 12:03 PM by patrickc28432750

    Getting email sent from php file

    patrickc28432750 Level 1

      Hi all

       

      I need some help, I have tried everything I can think of. I am calling a php file from my Javascript using ajax and it works perfectly fine with php script running without error. Inside the php script I try to send an email which doesn't work. See the code below

       

      <?PHP
        $to
      = "example@gmail.com";
        $subject
      = "Activate your Account";
        $headers
      = "From: sample@gmail.com";
        $body
      = "Email Sending Worked";
        
      if(!mail($to, $subject, $body, $headers))
        
      {
        
      die("We couldn't sign you up this time. Please try again");
        
      }
      ?>

       

      Has anyone encountered or used this before when creating phone gap application

       

      Thanks in advance for any help