-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontact_mail.php
36 lines (27 loc) · 999 Bytes
/
contact_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
<!-- sends contact message to company, then redirects to a success message screen -->
<?php
$name = $_POST['name'];
$email = $_POST['email'];
$address = $_POST['address'];
$city = $_POST['city'];
$country = $_POST['country'];
$body = $_POST['body'];
$message = "Name: " . $name . "\n" .
"Email: " . $email . "\n" .
"Address: " . $address . "\n" .
"City: " . $city . "\n" .
"Country: " . $country . "\n" .
"Body: " . $body;
// echo $message;
ini_set( 'display_errors', 1 );
error_reporting( E_ALL );
$from = "smtp.hostinger.com";
$to = "jmferna91@gmail.com, ttlacamila@gmail.com";
$subject = "Contact Message";
// $message = "PHP mail works just fine";
$headers = "From:" . $from;
mail($to,$subject,$message, $headers);
// echo "The email message was sent.";
header("Location: ./contact_success.php");
// exit();
?>