Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Formato email php (class.phpmailer)
- <?php
- require("class.phpmailer.php");
- foreach($_POST as $campo => $valor){
- $asignacion = "\$" . $campo . "='" . $valor . "';";
- utf8_encode(eval(nl2br($asignacion)));
- }
- $formato;
- $formato = "---------------------------------- <br/>";
- $formato.= " Formulario de Contacto <br/>";
- $formato.= "---------------------------------- <br/>";
- $formato.= "<table border='1'>";
- $formato.= "<tr>";
- $formato.= "<td>";
- $formato.= "Nombre:";
- $formato.= "</td>";
- $formato.= "<td>";
- $formato.= $nombre;
- $formato.= "</td>";
- $formato.= "</tr>";
- $formato.= "<tr>";
- $formato.= "<td>";
- $formato.= "Telefono:";
- $formato.= "</td>";
- $formato.= "<td>";
- $formato.= $telefono;
- $formato.= "</td>";
- $formato.= "</tr>";
- $formato.= "<tr>";
- $formato.= "<td>";
- $formato.= "Email:";
- $formato.= "</td>";
- $formato.= "<td>";
- $formato.= $email;
- $formato.= "</td>";
- $formato.= "</tr>";
- $formato.= "<tr>";
- $formato.= "<td>";
- $formato.= "Mensaje:";
- $formato.= "</td>";
- $formato.= "<td>";
- $formato.= $mensaje;
- $formato.= "</td>";
- $formato.= "</tr>";
- $formato.= "</table>";
- $mail = new PHPMailer();
- $mail->Host = "localhost";
- $mail->From = $email;
- $mail->FromName = $nombre;
- $mail->Subject = "Formulario de Contacto";
- $mail->AddAddress("email@email", $nombre);
- $body = $formato;
- $mail->Body = $body;
- $mail->AltBody = "Hola jefe<br/> Que tenga un buen dia<br/><br/>Saludos";
- $mail->Send();
- //echo 1;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment