1 Reply Latest reply on Apr 18, 2006 9:34 AM by elmson

    Variables will not come through from mailer

    elmson Level 1
      I have a php mailer on my site mortgagemaestro.net and the variables will not come through when I send the form from any computer but mine. I just get a blank form in my email.
      Here are both codes

      Thanks for any help

      stop();

      var b1Load:LoadVars = new LoadVars();
      var receiveLoad:LoadVars = new LoadVars();

      this.b1.onRelease = function() {
      if (theEmail.text == null || theEmail.text =="" || theName.text == null || theName.text =="" || homePhone.text == null || homephone.text =="" ){
      gotoAndStop("error");
      }else {
      b1Load.theName = theName.text;
      b1Load.homePhone = homePhone.text;
      b1Load.workPhone = workPhone.text;
      b1Load.theEmail = theEmail.text;
      b1Load.theAddress = theAddress.text;
      b1Load.theCity = theCity.text;
      b1Load.theState = theState.text;
      b1Load.theZip = theZip.text;
      b1Load.theCall = theCall.text;
      b1Load.sendAndLoad(" http://www.mortgagemaestro.net/lib/phpmailer/email.php", receiveload);
      getURL(" http://l-h1.com/richard_white_lending/destpage/thankyou.php", "_self");
      }

      <?PHP
      require("class.phpmailer.php");

      $mail = new PHPMailer();

      $mail->IsSMTP(); // send via SMTP
      $mail->Host = "mail.mortgagemaestro.net"; // SMTP servers
      $mail->SMTPAuth = true; // turn on SMTP authentication
      $mail->Username = "lead@mortgagemaestro.net"; // SMTP username
      $mail->Password = "32bf1a3"; // SMTP password

      $mail->From = "lead@mortgagemaestro.net";
      $mail->FromName = "Lead";
      $mail->AddAddress("jwhite@richardwhitelending.com");

      $mail->Subject = "Mortgage Maestro Lead";
      $mail->Body = "Name: ";
      $mail->Body .= $_POST[theName];
      $mail->Body .= "\nEmail: ";
      $mail->Body .= $_POST[theEmail];
      $mail->Body .= "\nHomePhone: ";
      $mail->Body .= $_POST[homePhone];
      $mail->Body .= "\nWorkPhone: ";
      $mail->Body .= $_POST[workPhone];
      $mail->Body .= "\nAddress: ";
      $mail->Body .= $_POST[theAddress];
      $mail->Body .= "\nCity: ";
      $mail->Body .= $_POST[theCity];
      $mail->Body .= "\nState: ";
      $mail->Body .= $_POST[theState];
      $mail->Body .= "\nZip: ";
      $mail->Body .= $_POST[theZip];
      $mail->Body .= "\nCall: ";
      $mail->Body .= $_POST[theCall];

      if(!$mail->Send())
      {
      echo "Message was not sent <p>";
      echo "Mailer Error: " . $mail->ErrorInfo;
      exit;
      }

      echo "Message has been sent";

      ?>
        • 1. Re: Variables will not come through from mailer
          elmson Level 1
          Ok here it Is incase anyone ever has this problem. I changed all the instance names like theCall and theName to variables. This is done by changing them in the box labeled var: kind of in the lower right of properties. I also changed the form to the POST method and made my form a movie clip that called sendWork

          Well here are scripts.
          I am still having a problem with my if statements. they stopped working after I changed everything to variables. It would still bring me to the error screen that I have set up even when I had all the information entered.

          I know it is because they are set up using the instance names ( see above script) but when I figure that out everything will be running smooth, hopefully


          stop();

          this.b1.onRelease = function() {
          sendWork.loadVariables("email.php", "POST");
          getURL(" http://l-h1.com/richard_white_lending/destpage/thankyou.php", "_self");
          };




          <?PHP
          require("class.phpmailer.php");

          $mail = new PHPMailer();

          $mail->IsSMTP(); // send via SMTP
          $mail->Host = "mail.mortgagemaestro.net"; // SMTP servers
          $mail->SMTPAuth = true; // turn on SMTP authentication
          $mail->Username = "lead@mortgagemaestro.net"; // SMTP username
          $mail->Password = "32bf1a3"; // SMTP password

          $mail->From = "lead@mortgagemaestro.net";
          $mail->FromName = "Lead";
          $mail->AddAddress("jwhite@richardwhitelending.com");

          $mail->Subject = "Mortgage Maestro Lead";
          $mail->Body = "Name: ";
          $mail->Body .= $_POST[theName];
          $mail->Body .= "\nEmail: ";
          $mail->Body .= $_POST[theEmail];
          $mail->Body .= "\nHomePhone: ";
          $mail->Body .= $_POST[homePhone];
          $mail->Body .= $_POST[homePhone02];
          $mail->Body .= $_POST[homePhone03];
          $mail->Body .= "\nWorkPhone: ";
          $mail->Body .= $_POST[workPhone];
          $mail->Body .= $_POST[workPhone02];
          $mail->Body .= $_POST[workPhone03];
          $mail->Body .= "\nAddress: ";
          $mail->Body .= $_POST[theAddress];
          $mail->Body .= "\nCity: ";
          $mail->Body .= $_POST[theCity];
          $mail->Body .= "\nState: ";
          $mail->Body .= $_POST[theState];
          $mail->Body .= "\nZip: ";
          $mail->Body .= $_POST[theZip];
          $mail->Body .= "\nCall: ";
          $mail->Body .= $_POST[theCall];

          if(!$mail->Send())
          {
          echo "Message was not sent <p>";
          echo "Mailer Error: " . $mail->ErrorInfo;
          exit;
          }