Está en la página 1de 4

INSTITUCIÓN EDUCATIVA SUPERIOR TECNOLÓGICO PÚBLICO

“CARLOS SALAZAR ROMERO”


Instituto de Excelencia

PROGRAMA DE ESTUDIOS
“COMPUTACIÓN E INFORMÁTICA”

UNIDAD DIDÁCTICA: TALLER DE PROGRAMACIÒN WEB

ESTUDIANTE : ROBLES ROJAS JOSÉ LUIS

CICLO : VI Turno: NOCHE

SEMANA : 9-CREACION CORREO ELECTRONICO

Docente de la Unidad Didáctica


ING. CIP. JOHN HILMER VÉLIZ CRUZ

Nuevo Chimbote – Perú

2021
Desarrolla páginas dinámicas con el lenguaje PHP haciendo uso de sesiones, ficheros y correo
electrónicos.

DESARROLLO DEL EJERCICIO


<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<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...";
}
}
}
?>

También podría gustarte