karlitoos.nl Posted June 14, 2011 Report Share Posted June 14, 2011 Chicos tengo un formulario de la forma: <HTML> <BODY> <FORM ACTION="mailto:[email protected]" METHOD=POST> Pregrado <SELECT NAME="equipos"> <OPTION VALUE="gallina" SELECTED>Universidad de Concepción <OPTION VALUE="bostero">Pontificia Universidad Católica de Chile <OPTION VALUE="rojo">Universidad Adolfo Ibáñez <OPTION VALUE="academia">Universidad del Desarrollo <OPTION VALUE="cuervo">Universidad de Chile <OPTION VALUE="cuervo">Universidad de Santiago <OPTION VALUE="cuervo">Universidad de Talca <OPTION VALUE="cuervo">Universidad de la Frontera <OPTION VALUE="cuervo">Universidad de Tarapacá <OPTION VALUE="cuervo">Universidad del Bío-Bío <OPTION VALUE="cuervo">Universidad de Antofagasta <OPTION VALUE="cuervo">Universidad Católica de la Santísima Concepción </SELECT> </FORM> <td align="right" width="150"><INPUT NAME="boton" TYPE="SUBMIT" VALUE="Enviar"> </td> </BODY> </FORM> </HTML> pero quiero que la opcion de lo despegable, llegue de respuesta a mi mail. alguna orientacion? gracias. Link to comment Share on other sites More sharing options...
cañangasñangas Posted June 14, 2011 Report Share Posted June 14, 2011 (edited) cumpita el tag <option> tiene tag de cierre por lo que debes cerrar c/ option <HTML> <BODY> <FORM ACTION="mailto:[email protected]" METHOD=POST> Pregrado <SELECT NAME="equipos"> <OPTION VALUE="gallina" SELECTED>Universidad de Concepción</OPTION> <OPTION VALUE="bostero">Pontificia Universidad Católica de Chile</OPTION> <OPTION VALUE="rojo">Universidad Adolfo Ibáñez</OPTION> <OPTION VALUE="academia">Universidad del Desarrollo</OPTION> <OPTION VALUE="cuervo">Universidad de Chile</OPTION> <OPTION VALUE="cuervo">Universidad de Santiago</OPTION> <OPTION VALUE="cuervo">Universidad de Talca</OPTION> <OPTION VALUE="cuervo">Universidad de la Frontera</OPTION> <OPTION VALUE="cuervo">Universidad de Tarapacá</OPTION> <OPTION VALUE="cuervo">Universidad del Bío-Bío</OPTION> <OPTION VALUE="cuervo">Universidad de Antofagasta</OPTION> <OPTION VALUE="cuervo">Universidad Católica de la Santísima Concepción</OPTION> </SELECT> </FORM> <td align="right" width="150"><INPUT NAME="boton" TYPE="SUBMIT" VALUE="Enviar"> </td> </BODY> </FORM> </HTML> mediante php lo que tu deseas es facil y siempre y cuando tengas un servidor smtp recuperas la info asi: $equipoSeleccionado = $_POST["equipos"] $mensaje = "Este es el equipo seleccionado: $equipoSeleccionado"; la ejecucion de mailto: no enviará el mail, solo abrira tu programa de correo entrante predeterminado mail($paraElMail, $asunto, $mensaje, $cabeceraDelMail); saludos y chao Edited June 14, 2011 by cañangasñangas Link to comment Share on other sites More sharing options...
alvcuevas Posted June 16, 2011 Report Share Posted June 16, 2011 puedes ocupar la libreria phpmailer esta te deja enviar correos, ya sea tengas un smtp en tu pc o tubservidor, o tambien puedes ocupar algun otro smtp (hotmail,yahoo,gmail) Lo otro, como bien dice cañangasñangas te faltan los </option> y tienes un </form> de mas pa ejemplificar tu pedido.. necesitas el archivo form.php q tendria lo siguiente <HTML> <BODY> <FORM ACTION="mail.php" METHOD=POST> Pregrado <SELECT NAME="equipos"> <OPTION VALUE="gallina" SELECTED>Universidad de Concepción</OPTION> <OPTION VALUE="bostero">Pontificia Universidad Católica de Chile</OPTION> <OPTION VALUE="rojo">Universidad Adolfo Ibáñez</OPTION> <OPTION VALUE="academia">Universidad del Desarrollo</OPTION> <OPTION VALUE="cuervo">Universidad de Chile</OPTION> <OPTION VALUE="aaa">Universidad de Santiago</OPTION> <OPTION VALUE="adad">Universidad de Talca</OPTION> <OPTION VALUE="qwe">Universidad de la Frontera</OPTION> <OPTION VALUE="adrad">Universidad de Tarapacá</OPTION> <OPTION VALUE="ghnhn">Universidad del Bío-Bío</OPTION> <OPTION VALUE="uyiyi">Universidad de Antofagasta</OPTION> <OPTION VALUE="oioioio">Universidad Católica de la Santísima Concepción</OPTION> </SELECT> <table> <tr> <td align="right" width="150"><INPUT NAME="boton" TYPE="SUBMIT" VALUE="Enviar"> </td> </tr> </table> </BODY> </FORM> </HTML> en el archivo mail.php tendrias el siguiente codigo <?php require_once("class.phpmailer.php"); $mail = new PHPMailer(); $mail->Mailer = "smtp"; $mail->Host = "ssl://localhost"; // SMTP server $mail->SMTPAuth = true; $mail->Port = 465;//PUERTO Q OCUPA TU SMTP $mail->Username = "XXXXX"; //NOMBRE DE USUARIO $mail->Password = "XXXX";//CLAVE DE USUARIO $mail->From = "[email protected]";//NOMBRE DEL CORREO Q ENVIA $mail->FromName = "TU NOMBRE";//tU NOMBRE $mail->Subject ="ASUNTO";//TU ASUNTO $mail->Body = $_POST['equipos']; $mail->AddAddress("QUIEN RECIBE");//CORREO Q RECIBE $exito=$mail->Send(); if(!$exito){ echo "Problemas enviando correo electrónico"; echo " ".$mail->ErrorInfo; } else{ echo "Mensaje enviado correctamente <br>".$rs['Destino']; } Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now