-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathemail.php
More file actions
53 lines (46 loc) · 1.22 KB
/
email.php
File metadata and controls
53 lines (46 loc) · 1.22 KB
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
<?php
/*Twitter Bootstrap PHP Mailer v1.0a
Anthony Hill - Hill.Anthony@live.com
10/7/12
*/
// Validator
require_once 'is_email.php';
// Get their email
if(isset($_GET['email']))
{
$email = $_GET['email'];
} else {
echo 'No e-mail set';
exit;
}
// Fill these in
// $to is your e-mail address that you want people to contact you on
// Example: $to = "youremail@gmail.com"
$to = "";
// $from should be an e-mail on your website. Check with your web host if you need help here.
$from = "";
/* Don't modify below this point if you don't know what you're doing */
$subject = "$email has contacted you";
$website = $_GET['website'];
$name = $_GET['name'];
// Validate
$result = is_email($email, true, true);
if ($result !== ISEMAIL_VALID) {
echo "$email is not a valid email address (result code $result)";
exit;
}
// Make sure the message isn't null
if($_GET['message'] != '')
{
$message = "E-Mail: $email\r\nWebsite: $website\r\nContact Name: $name\r\n\r\nMessage:\r\n";
$message .= $_GET['message'];
} else {
echo 'Please enter a valid message.';
exit;
}
$headers = "From: $from" . "\r\n" .
"Reply-To: $email" . "\r\n" .
'X-Mailer: PHP/' . phpversion();
echo 'Your e-mail has been sent';
mail($to, $subject, $message, $headers);
?>