-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsendemail.php
43 lines (38 loc) · 883 Bytes
/
sendemail.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
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8" />
<title>Sending mail ...</title>
<style type="text/css">
body {
background-color: transparent;
}
.ok {
margin-top: 10px;
color:#1A1;
}
.err {
margin-top: 10px;
color:#A11;
}
</style>
</head>
<body>
<?php
error_reporting(E_ALL ^ E_NOTICE);
$admin = '[email protected]';
$name = $_POST['name'];
$email = $_POST['email'];
$msg = $_POST['message'];
if( strlen($name)>=3 && strlen($email)>=7 && strlen($msg)>=8 ){
if( @mail ( $admin,"omidgharib.ir contact : $subject", $msg, "From:$admin\r\nReply-To:$name <$email>" ) ){
echo '<h2 class="ok">Your message was sent.</h2>';
}else{
echo '<h2 class="err">Your message was not sent please try again.</h2>';
}
}else{
echo '<h2 class="err">Your message was not sent please try again.</h2>';
}
?>
</body>
</html>