Formulario AS3 + phpmailer

Hola.

Estoy creando un website en flash y necesito poner un formulario.

Siempre había usado php simple para recoger las variables del formulario flash y enviar-las al correo a través del hosting:

AS3:

var misVariables:URLVariables = new URLVariables();var cargador:URLLoader = new URLLoader();var pedido:URLRequest = new URLRequest();pedido.url="http://www.url.es/CTA/Producto/enviarMail_Producto.php"; PHPpedido.method = URLRequestMethod.POST;pedido.data = misVariables;cargador.dataFormat = URLLoaderDataFormat.VARIABLES;enviar_btn.addEventListener(MouseEvent.CLICK, enviar);cargador.addEventListener(Event.COMPLETE, cargaCompleta);function enviar (event:MouseEvent){if(mail_txt.text.indexOf("@")== -1 || mail_txt.text.indexOf(".")== -1){status_txt.text = "Introduce un mail correcto";}else{enviarFormulario();}}function enviarFormulario(){misVariables.nombre = nombre_txt.text;misVariables.teléfono = telefono_txt.text;misVariables.mail = mail_txt.text;misVariables.mensaje = mensaje_txt.text;try{cargador.load(pedido);}catch (error:Error){trace ("Error en el envío"+error)}}function cargaCompleta(event:Event):void{nombre_txt.text="";telefono_txt.text="";mail_txt.text="";mensaje_txt.text="";gotoAndStop (5);}

PHP (enviarMail.php):

<?php
$nombre = $_POST["nombre"];
$teléfono = $_POST["teléfono"];
$mail = $_POST["mail"];
$mensaje .= "Mail: " . $_POST['mail'] . "\n";
$mensaje .= "Mensaje: Está interesado en recibir información adicional sobre: Vídeo Producto\n\n";
/*$mensaje .= "Mensaje: " . $_POST['mensaje'] . "\n\n";
*/
$cabecera = "From: $nombre <$mail> \r\n";
$cabecera .= "Reply-To: $mail";
if(mail("[email protected]", "Formulario desde el Sitio", $mensaje, $cabecera)){
echo "estado=Su mensaje fue Enviado correctamente";
}
else{
echo "estado=Su mensaje NO fue enviado";
}
?>

El caso es que ahora me dicen que éste sistema no puedo usar-lo y me dicen que lo haga con phpmailer.

Me podríais ayudar con el cambio?

Gracias!

Añade tu respuesta

Haz clic para o