blob: f07087fbf05f9046fde348ec11c8cf505e8a36b0 (
plain)
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
27
28
29
30
31
32
|
<?php
// Check for empty fields
if(empty($_POST['nombre']) ||
empty($_POST['correo']) ||
empty($_POST['mensaje']) ||
!filter_var($_POST['correo'],FILTER_VALIDATE_EMAIL))
{
return false;
}
$name = strip_tags(utf8_decode(htmlspecialchars($_POST['nombre'])));
$email_address = strip_tags(htmlspecialchars($_POST['correo']));
$message = strip_tags(utf8_decode(htmlspecialchars($_POST['mensaje'])));
// Create the email and send the message
$to = 'user@domain.at'; // Add your email address
$email_subject = <<<EOT
[heckyel.ga] Mensaje de {$name}
EOT;
$email_body = <<<EOT
Haz recibido un nuevo mensaje del formulario de contacto de tu sitio web.\n\n
Aqui estan los detalles:\n\n
Nombre: {$name}\n\n
Email: {$email_address}\n\n
Mensaje:\n
{$message}
EOT;
$headers = "From: noreply@heckyel.ga\n"; // Using something like noreply@yourdomain.com.
$headers .= "Reply-To: $email_address";
mail($to,$email_subject,$email_body,$headers);
return true;
|