/
mail.php
68 lines (56 loc) · 1.94 KB
/
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<?php
$mail = $_POST['mail'];
$name = $_POST['name'];
$subject = $_POST['subject'];
$text = $_POST['text'];
$ip = $_SERVER['REMOTE_ADDR'];
$date = date('F j, Y, g:i a');
$to = "marvil.joy@gmail.com";
$message = '<table width="600" cellspacing="0" cellpadding="0" border="0" bgcolor="#ffffff" align="center" style="border:10px solid #c8e5f6" >
<tbody>
<tr>
<td valign="top" align="left">
<table width="650" cellspacing="0" cellpadding="0" border="0" style="border-bottom:1px solid #cccccc">
<tbody>
<tr>
<td width="245" valign="middle" align="left" style="padding:15px"><img width="128" height="128" alt="Marvil Joy - Github" src="http://marviljoy.github.io/photo/marvil.jpg"></td>
<td width="285" valign="middle" align="right" style="font-family:Arial;font-size:14px;color:#555555;padding:30px">
<strong>Contact Info</strong>
<br>
<br>
'.$date.'</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td valign="top" align="left">
<table width="650" cellpadding="0" border="0" style="padding:30px 30px 30px 30px">
<tbody>
<tr>
<td style="font-family:Arial;font-size:14px;padding-bottom:15px">
<b>New Contact Information recieved</b>
</td>
</tr>
<p>Name: <b>'.$name.'</b> </p>
<p>Email: <b>'.$mail.'</b> </p>
<p>Subject: <b>'.$subject.'</b> </p>
<p>Message: <b>'.$text.'</b> </p>
</tbody>
</table>
</td>
</tr>
</table>';
$headers = "MIME-Version: 1.0\r\n"
."Content-Type: text/html; charset=iso-8859-1\r\n"
."Content-Transfer-Encoding: 8bit\r\n"
."From: =?UTF-8?B?". base64_encode($name." - Github Page") ."?= <".$mail.">\r\n"
."X-Mailer: PHP/". phpversion();
if(mail($to, $subject,$message, $headers)){
echo "<p>Message sent! Thanks!</p>";
}
else{
echo "<p>Error</p>";
}
?>