1 Reply Latest reply on Apr 27, 2011 11:04 PM by Darshan Rane

    Problem with phpmailer script

    fificienta

      I made a form in Flash AS3. With 5 input text (name, email, bla, blab, bla) and a button that sends me to a php file email.php. I'm using phpmailer for making the form. I have already download the class.phpmailer.php and class.smtp.php files; and i copy the script from internet. But it isn`t working. Can anyone help me please? I will aprecciate so much ur help and time.

       

      <?
      $name=$_POST ['nom'];
      $email=$_POST ['email'];
      $enterprise=$_POST ['empresa'];
      $topic=$_POST ['motivo'];
      $message=$_POST ['mensaje'];

       

      require 'class.phpmailer.php';
      require 'class.smtp.php'; //incluimos la clase para envíos por SMTP

      $mail = new PHPMailer();
      $mail->IsSMTP();
      $mail->CharSet = 'UTF-8';
      $mail->SMTPAuth = true;
      $mail->SMTPSecure = "ssl";
      $mail->Host       = "smtp.gmail.com";
      $mail->Port       = 465;
      $mail->Username = "********@gmail.com";
      $mail->Password = "********";

      $mail->SetFrom($_POST[email],$_POST[nom]);
      $mail->AddAddress("********@gmail.com", "Fiorella");
      $mail->Subject = "Formulario de Contacto";
          $mail->MsgHTML('$_POST[mensaje]');//cuerpo con h

      if(!$mail->Send()) {//finalmente enviamos el email
         echo $mail->ErrorInfo;//si no se envía correctamente se muestra el error que ocurrió
      } else {
         echo 'Correo enviado correctamente';
      }

      ?>

       

      Message was edited by Jochem van Dieten to remove username / password