-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexe_mail.php
43 lines (32 loc) · 960 Bytes
/
exe_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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
if(!isset($_SESSION['user_id']))
session_start();
include("includes/body.php");
if(isset($_POST['nome']) && isset($_POST['mail']) && isset($_POST['msg']))
{
if($_POST['nome'] == "")
{
header("location:contactos.php?erro=nome");
exit();
}
elseif($_POST['mail'] == "" && validateEmail($_POST['mail']) == "false")
{
header("location:contactos.php?erro=mail");
exit();
}
elseif($_POST['msg'] == "")
{
header("location:contactos.php?erro=msg");
exit();
}
if($_POST['assunto'] != "")
$assunto= $_POST['assunto'];
$headers .= 'From: '.$_POST['nome'].' ['.$_POST['mail'].']';
$headers .= 'Reply-To: '.$_POST['nome'].' ['.$_POST['mail'].']';
$msg = $_POST['msg'];
mail("[email protected]",$assunto,$msg,$headers);
}else{
header("location:contactos.php?form=not");
exit();
}
?>