-
Notifications
You must be signed in to change notification settings - Fork 1
/
mail.php
26 lines (22 loc) · 949 Bytes
/
mail.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
if(!empty($_POST)){
$email_to = "pruebaprograavanzada@gmail.com";
$email_subject = "Nuevo Contacto Tiki!";
$email_message = "Detalles del formulario de contacto:\n\n";
$email_message .= "Nombre: " . $_POST['nombre'] . "\n";
$email_message .= "Correo: " . $_POST['correo'] . "\n";
$email_message .= "Asunto: " . $_POST['asunto'] . "\n";
$email_message .= "Mensaje: " . $_POST['mensaje'] . "\n\n";
// Ahora se envía el e-mail usando la función mail() de PHP
$mail = $_POST['correo'];
$header = 'From: ' . $mail . " \r\n";
$header .= "X-Mailer: PHP/" . phpversion() . " \r\n";
$header .= "Mime-Version: 1.0 \r\n";
$header .= "Content-Type: text/plain";
if(mail($email_to, $email_subject, $email_message,$header)){
echo 'exito';
}else{
echo 'error';
}
}
?>