-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmymail.php
More file actions
65 lines (55 loc) · 1.75 KB
/
Copy pathmymail.php
File metadata and controls
65 lines (55 loc) · 1.75 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
54
55
56
57
58
59
60
61
62
63
64
65
<?php
// require_once "Mail.php";
$name = $_POST['name'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$ctype = $_POST['ctype'];
$area = $_POST['area'];
$location = $_POST['location'];
$subject = 'Website Inquiry';
$message = $_POST['message'];
$from = "info@sipljod.com";
if(!empty($email)){
//$from = "SIPL JOD <".$email.">";
$from = "info@sipljod.com";
$to = "sipljod@gmail.com";
$subject = $subject;
$body = "Inquiry For you\n\r<br>";
$body .= "Name : ".$name."\n\r<br>";
$body .= "Construction type : ".$ctype."\n\r<br>";
$body .= "Email : ".$email."\n\r<br>";
$body .= "Phone : ".$phone."\n\r<br>";
$body .= "Area : ".$area."\n\r<br>";
$body .= "Location : ".$location."\n\r<br>";
$body .= "Please check and revert Back\n\r<br>";
// $host = "mail.happyevents.co.in";
// $username = "mail@happyevetns.co.in";
// $password = "happy-8991";
// $headers = array ('From' => $from,
// 'To' => $to,
// 'Subject' => $subject);
// $smtp = Mail::factory('smtp',
// array ('host' => $host,
// 'auth' => true,
// 'username' => $username,
// 'password' => $password));
// $mail = $smtp->send($to, $headers, $body);
// 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";
// More headers
$headers .= 'From: '.$from.'' . "\r\n";
// $headers .= 'Cc: myboss@example.com' . "\r\n";
$mail = mail($to,$subject,$body, $headers);
if($mail){
echo("<p>Message successfully sent!</p>");
header('Location: inquiry.html');
}
// if (PEAR::isError($mail)) {
// echo("<p>" . $mail->getMessage() . "</p>");
// } else {
// echo("<p>Message successfully sent!</p>");
// header('Location: contact.html');
// }
}
?>