-
Notifications
You must be signed in to change notification settings - Fork 0
/
mail.php
51 lines (44 loc) · 1.54 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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>email</title>
</head>
<body>
<?php
if (isset($_POST['email1']))
//if "email," is filled out, send email
{
//send email
$subject = "EarthMiles: Mail Form";
$email = 'Email not Supplied';
if(isset($_POST['email1'])) {
$email = $_POST['email1'] ;
}
$message = '<html><body>';
$message .= "<h1>$subject</h1>";
$message .= "<Strong>Email ID: $email1 </Strong><br/>";
$message .= '</body></html>';
// To send HTML mail, the Content-type header must be set
// $to = "EarthMiles: <[email protected]>";
$to = "EarthMiles: <[email protected]>";
// Always set content-type when sending HTML email
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
mail($to, $subject, $message, $headers);
echo "<p>Thank you for contacting us.</p>";
}
else
{
?>
<form method="post" action="<?php echo $_SERVER["PHP_SELF"];?>" class="form-inline" role="form">
<div class="form-group">
<label class="sr-only" for="exampleInputEmail2">Enter Your email</label>
<input type="email" for="mail" placeholder="Enter Your email" name="email1" id="email1" class="form-control btn-lg" >
</div>
<button type="submit" class="btn btn-primary">Send</button>
</form>
<?php
}
?>
</body>
</html>