Documentos de Académico
Documentos de Profesional
Documentos de Cultura
PROGRAMA DE ESTUDIOS
“COMPUTACIÓN E INFORMÁTICA”
2021
Desarrolla páginas dinámicas con el lenguaje PHP haciendo uso de sesiones, ficheros y correo
electrónicos.
<title>Correo Electronico</title>
<link rel="stylesheet" href="Estilos.css">
</head>
<body>
<form method="post" action="">
<input type="text" placeholder="Nombres" name="txtnombre">
<input type="email" placeholder="Correo" name="txtcorreo">
<input type="text" placeholder="asunto" name="txtasunto">
<textarea placeholder="mensaje" name="msg"></textarea>
<input type="submit" name="Enviar Correo">
</form>
<?php
include("encorreo.php");
?>
</body>
</html>
*{
margin: 0px;
padding: 0px;
font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;
}
body{
background-color: cadetblue;
}
form{
width: 700px;
margin:auto;
background-color: darkgoldenrod;
}
input{
margin: 15px;
padding: 10px;
width: 600px;
font-size: 16px;
margin-bottom: 5px;
}
textarea{
font-size: 16px;
margin: 15px;
padding: 10px;
min-width: 600px;
max-width: 600px;
min-height: 100px;
}
input[type="submait"]{
margin-bottom: 5px;
margin-top: 15px;
}
<?php
if(isset($_POST['enviar correo'])){
if(!empty($_POST['txtnombre']) && !empty($_POST['txtasunto'])
&& !empty($_POST['msg']) && !empty($_POST['txtcorreo'])){
$nombre=$_POST['txtnombre'];
$asunto=$_POST['txtasunto'];
$msg=$_POST['msg'];
$correo=$_POST['correo'];
$header="form:roblesrojasjoseluis1966@gmail.com"."\n\n";
$header="x-mailer:php/". phpversion();
$header="Reply to:roblesrojasjoseluis1966@gmail.com"."\n\n";
$mail=mail($correo,$asunto,$msg,$header);
if($mail){
echo "Tu correo fue enviado exitosamente...";
}
}
}
?>