-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsend.php
39 lines (23 loc) · 1.11 KB
/
send.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
<?php
// Here we get all the information from the fields sent over by the form.
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
$Bname =$_POST['n2'];
$num =$_POST[n7];
$altnum = $_POST[n8];
$typeofbuss = $_POST[n4];
$yinbuss = $_POST[n5];
$annualgros=$_POST[n6];
$to = '[email protected]';
$subject = 'Inquiry for Consultation';
$message = 'FROM: '.$name."\r\n".'Business Name:'.$Bname."\r\n".' Email: '.$email."\r\n".'Type of Business:'.$typeofbuss."\r\n".'Years in Business:'.$yinbuss."\r\n".'Annual Gross:'.$annualgros."\r\n".'Contact Num:'.$num."\r\n".'Alt Num:'.$altnum."\r\n".'Message: '.$message;
$headers = 'From: [email protected]' . "\r\n";
if (filter_var($email, FILTER_VALIDATE_EMAIL)) { // this line checks that we have a valid email address
mail($to, $subject, $message, $headers); //This method sends the mail.
echo '<script>window.open("nextpage.html");</script>';
echo "Thank You! A CPC Finance Account Executive will contact you within 24 hours for your consultation"; // success message
}else{
echo "Invalid Email, please provide an correct email.";
}
?>