Codigo html:
Código HTML:
<form id="form1" name="form1" method="post" action="phpmailer-gmail/index.php"> <p>Nombre:<br /> <label> <input name="nombre" type="text" id="nombre" /> </label> <br /> Telefono:<br /> <input name="telefono" type="text" id="telefono" /> <br /> Email:<br /> <input name="email" type="text" id="email" /> <br /> Mensaje:<br /> <textarea name="mensaje" id="mensaje"></textarea> <br /> <label> <input type="submit" name="Submit" value="Enviar Formulario" /> </label> </p> </form>
Código PHP:
<?php
include("class.phpmailer.php");
include("class.smtp.php");
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->SMTPAuth = true;
$mail->SMTPSecure = "ssl";
$mail->Host = "smtp.gmail.com";
$mail->Port = 465;
$mail->Username = "[email protected]";
$mail->Password = "28347812742";
$mail->From = "[email protected]";
$mail->FromName = "Usuario Lalala";
$mail->Subject = "Lalala";
$mail->AltBody = "Hola, te doy mi nuevo numero\nxxxx.";
$mail->MsgHTML("Hola, te doy mi nuevo numero<br><b>xxxx</b>.");
$mail->AddAttachment("files/files.zip");
$mail->AddAttachment("files/img03.jpg");
$mail->AddAddress("[email protected]", "Destinatario");
$mail->IsHTML(true);
if(!$mail->Send()) {
echo "Error: " . $mail->ErrorInfo;
} else {
echo "Mensaje enviado correctamente";
}
?>
Hola, te doy mi nuevo numero
xxxx
Como hago para comunicar el formulario html con el archivo php ?
Saludos espero respuestas y gracias...