8 Replies Latest reply on Apr 20, 2009 2:14 AM by khanou

    Problem Mail Flex/PHP

    khanou

      Hi,

       

      I have actually a problem to send email by my Air App.

       

      I use an HTTPService in my app and a PHP script on my Linux server.

       

      This is my code to send the mail from my Air App

       

      sendMail.url = WEB_ROOT_PATH + '/./sendMail.php';

      sendMail.send();

       

      This is the declaration of my service

       

      <mx:HTTPService id="sendMail" useProxy="false" result="mailSend(event)" method="POST"/>  
      

       

      And this is my PHP Script

       

      #!/usr/bin/php 
       
      <?php 
      
       $to = "toto@gmail.com"; 
       $subject = "my subject"; 
       $msg = "my message"; 
       
       $header = 'From: titi <titi@gmail.com>'."\n"; 
       $header .= "\n"; 
       echo mail($to, $subject, $msg, $header); 
       echo " mail send"; 
      
      ?> 
      

       

      If I call my script in my Linux term (./sendMail.php) the mail is well sent

       

      In my Air App I get this Result Event message

       

      (mx.messaging.messages::AcknowledgeMessage)#0
        body = "<?php
      
      $to = "toto@gmail.com";
      $subject = "my subject";
      $msg = "my message";
      
      $header = 'From: titi <titi @gmail.com>'."\n";
      $header .= "\n";
      
      echo mail($to, $subject, $msg, $header);
      
      echo " mail send";
      
      ?>
      
      "
        clientId = "DirectHTTPChannel0"
        correlationId = "E1919F8B-4064-35F2-7541-AF872EEF06CC"
        destination = ""
        headers = (Object)#1
          DSStatusCode = 200
        messageId = "AA382B1F-1628-EC4E-E268-AF872F0E7F2A"
        timestamp = 0
        timeToLive = 0
      

       

      So my App find the script but didn't execut it ?

       

      Any Idea?

       

      Thanks