-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathcontact.php
executable file
·44 lines (32 loc) · 929 Bytes
/
contact.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
<?php
// Blank message to start with so we can append to it.
$message = '';
// Check that name & email aren't empty.
if(empty($_POST['name']) || empty($_POST['email'])){
die('Please ensure name and email are provided.');
}
// Construct the message
$message .= <<<TEXT
Name: {$_POST['name']}
Email: {$_POST['email']}
Website: {$_POST['website']}
Subject: {$_POST['subject']}
Message: {$_POST['message']}
{$checkString}
TEXT;
// Email to send to
$to = 'ampalanzi@gmail.com';
// Email Subject
$subject = 'You have been contacted!';
// Name to show email from
$from = 'Ukrave Design';
// Domain to show the email from
$fromEmail = 'ukravedesign.com';
// Construct a header to send who the email is from
$header = 'From: ' . $from . '<' . $fromEmail . '>';
// Try sending the email
if(!mail($to, $subject, $message, $header)){
die('Error sending email.');
}else{
die('Email sent!');
}