Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/jcmouse/public_html/app/code/include/model/database/db.class.php on line 18

Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/jcmouse/public_html/app/code/include/model/database/db.class.php on line 18

Deprecated: Function eregi_replace() is deprecated in /home/jcmouse/public_html/app/code/include/model/database/posts.php on line 322

Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/jcmouse/public_html/app/code/include/model/database/db.class.php on line 18

Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/jcmouse/public_html/app/code/include/model/database/db.class.php on line 18
Enviar Email con PHP - Code Army!
HAZLO TU MISMO | Hace 8 años          

Enviar Email con PHP


Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/jcmouse/public_html/app/code/include/model/database/db.class.php on line 18

<!DOCTYPE HTML>
<html>
<head>
<title>Contacto</title>
<link rel="stylesheet" type="text/css" href="../css/enviar.css"/>
<!--<meta http-equiv="refresh" content="2"/>-->
</head>
<body>
<div id="contenido">
<header>
<p>Titulo de la pagina</p>
</header>
<section>
<article>
<?php

$nombre = "";
$email = "";
$mensaje = "";

//Recibo las variables del formulario

$nombre = $_POST['nombre'];
$email = $_POST['email'];
$mensaje = $_POST['mensaje'];

//Te muestro las variables

echo "<h2>El mensaje que has enviado es:</h2>";
echo "<h4>Nombre: ";
echo $nombre;
echo "<br/>";
echo "Email: ";
echo $email;
echo "<br/>";
echo "Mensaje: ";
echo $mensaje;
echo "</h4>";

//Envio el email

$destino = "ejemplo@correo.com";
$asunto = "Has recibido un correo del blog";
$mensajemail = $nombre." con el email ".$email." te ha enviado el siguiente mensaje ".$mensaje;

if (mail($destino, $asunto, $mensaje)) {
echo "<h2>Mensaje enviado correctamente</h2>";
} else {
echo "error al enviar el mensaje";
}
?>
</article>
<h2><a href="../index.html">Inicio</a></h2>
</section>
</div>
</body>
</html>

Tags
Fuentes de Información
  • El contenido del post es de mi autoría, y/o, es un recopilación de distintas fuentes.
Dar Puntos
Quitar Puntos
 
10 Puntos
score +10/-0
1810
Visitas
mapas v2 and
Hazlo tu mismo
Enviar Email
Hazlo tu mismo
Comentarios
Edso8316
Soldado
 
 Colombia
Pais
 
 27
Puntos
 
 3
Posts
 
 0
Preguntas
 
 0
Respuestas
 
 Hombre
Sexo
Ordenar digi
Apuntes School/Univ
X

Se parte de Code Army!

Esta acción es solo para usuarios registrados