forked from alimd/ParsEngCo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsendmail.php
61 lines (53 loc) · 1.42 KB
/
sendmail.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<!DOCTYPE HTML>
<html lang="fa-IR">
<head>
<meta charset="UTF-8" />
<title>Sending mail ...</title>
<style type="text/css">
@font-face {
font-family: 'Nazanin';
src: url('fonts/BNazanin.eot');
src: url('fonts/BNazanin.eot?#iefix') format('embedded-opentype'),
url('fonts/BNazanin.woff') format('woff'),
url('fonts/BNazanin.ttf') format('truetype');
font-weight : normal;
font-style : normal;
-webkit-font-smoothing : antialiased;
}
:lang(fa-IR) {
font-family : 'Nazanin';
direction : rtl;
}
body {
background-color: transparent;
direction: rtl;
}
.ok {
color:#1A1;
}
.err {
color:#A11;
}
</style>
</head>
<body>
<?php
error_reporting(E_ALL ^ E_NOTICE);
$admin = '[email protected]';
$name = $_POST['name'];
$tell = $_POST['tell'];
$email = $_POST['mail'];
$msg = $_POST['msg'];
$subject = $_POST['subject'];
if( strlen($name)>=3 && strlen($email)>=7 && strlen($subject)>=5 && strlen($msg)>=8 && strlen($tell)>=11 ){
if( @mail ( $admin,"ParsEng.co contact : $subject", "$msg\r\n\r\nMobile: $tell", "From:$admin\r\nReply-To:$name <$email>" ) ){
echo '<h2 class="ok">با تشکر، ایمیل شما ارسال شد.</h2>';
}else{
echo '<h2 class="err">خطا در ارسال ایمیل، لطفا دوباره تلاش کنید.</h2>';
}
}else{
echo '<h2 class="err">خطا در اطلاعات فرم !</h2>';
}
?>
</body>
</html>