0 Replies Latest reply on Jul 19, 2006 6:08 PM by leabee

    AUTOMATIC EMAIL RESPONSE

    leabee
      Hello,

      I am having an issue with my automatic mail scrip its not working. My website is www.planetkids.com.au when you type in a message and press send it comes up with the your email has been sent yet the email is never recieved by the designated account. The script I'm putting on the button is...

      on (press) {
      initial_name = "0";
      initial_comment = "0";
      if (Number(length(name))>=1) {
      initial_name = "100";
      colorRequired = new color (bg_name);
      colorRequired.setRGB(0xF1F3F3);
      } else {
      colorRequired = new color (bg_name);
      colorRequired.setRGB(0xFFECE7);
      }

      if (Number(length(comment))>=1) {
      initial_comment = "100";
      colorRequired = new color (bg_comment);
      colorRequired.setRGB(0xF1F3F3);
      } else {
      colorRequired = new color (bg_comment);
      colorRequired.setRGB(0xFFECE7);
      }

      String.prototype.isEmail = function() {
      var ref = arguments.callee;
      if(this.indexOf("@") == -1) return false;
      if(!isNaN(this.charAt(0))) return false;
      var email, user, domain, user_dots, domain_dots;
      if((email = this.split("@")).length == 2) {
      if((domain = email[1]).split(".").pop().length > 4) return false;
      if(domain.split(".").length < 2) return false;
      if((user = email[0]).indexOf(".") && domain.indexOf(".")) {
      if(user.length == 1 || domain.length == 1) return false;
      if(domain.lastIndexOf(".") > domain.length-3) return false;
      for(var c, t, i = (user_dots = user.split(".")).length; i--;) {
      c = user_dots ; t = !ref.$_text.call(c, "-", ".", "_");
      if(t || !isNaN(c)) return false;
      };
      for(var c, t, i = (domain_dots = domain.split(".")).length; i--;) {
      c = domain_dots
      ; t = !ref.$_text.call(c, "-", ".");
      if(t || !isNaN(c)) return false;
      };
      } else return false;
      } else return false;
      return true;
      };
      String.prototype.isEmail.$_punctuation = function() {
      if(this == "") return false;
      for(var i = arguments.length; i--;) {
      if(this.indexOf(arguments ) == 0) return false;
      if(this.indexOf(arguments
      ) == this.length-1) return false;
      };
      return true;
      };
      String.prototype.isEmail.$_text = function() {
      var ref = arguments.caller;
      if(!ref.$_punctuation.apply(this, arguments)) return false;
      var others = arguments; var checkOthers = function(str) {
      for(var i = others.length; i--;) if(str == others ) return true;
      return false;
      };
      for(var c, alpha, num, i = this.length; i--;) {
      c = this.charAt(i).toLowerCase();
      alpha = (c <= "z") && (c >= "a");
      num = (c <= "9") && (c >= "0");
      if(!alpha && !num && !checkOthers(c)) return false;
      };
      return true;
      };

      // Usage Example

      var _trace = function(address) {
      return "(" + address + "): " + address.isEmail();
      };

      var checkEmail = function(address) {
      return address.isEmail();

      };

      if (checkEmail(email)) {
      colorRequired = new color (bg_email);
      colorRequired.setRGB(0xF1F3F3);
      } else {
      colorRequired = new color (bg_email);
      colorRequired.setRGB(0xFFECE7);
      }
      }


      on (release) {
      if (Number(initial_name) == 100 and Number(initial_comment) == 100 and (checkEmail(email)) == true) {
      loadVariablesNum("form.php", 0, "POST");
      gotoAndStop("thanks");
      }
      }



      and the php scrip I am using is...



      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
      <html>
      <head>
      <title>Contact</title>
      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
      </head>

      <body>
      <?PHP
      $to = "robb@planetshakers.com";
      $msg .= "This message has been sent from your Contact Form\n\n";
      $msg .= "Name: $name\n";
      $msg .= "Email: $email\n";
      $msg .= "Website: $website\n";
      $msg .= "Address 1: $address1\n";
      $msg .= "Address 2: $address2\n";
      $msg .= "City: $city\n";
      $msg .= "State: $state\n";
      $msg .= "Zip Code: $zip\n";
      $msg .= "Country: $country\n";
      $msg .= "Message: $comment\n";
      mail($to, $name, $msg, "From: Contact Form\nReply-To: $email\n");
      ?>

      </body>
      </html>