-
Notifications
You must be signed in to change notification settings - Fork 0
/
enquiryMailer.php
64 lines (47 loc) · 1.6 KB
/
enquiryMailer.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
52
53
54
55
56
57
58
59
60
61
62
63
64
<!DOCTYPE html>
<html>
<head>
<title>Send mail</title>
</head>
<body>
<?php
require 'master/PHPMailerAutoload.php';
$name=$_GET['name'];
$email=$_GET['email'];
$study=$_GET['study'];
$mob=$_GET['mob'];
$address=$_GET['address'];
$enqq=$_GET['enqq'];
$mail = new PHPMailer;
//$mail->SMTPDebug = 4;
$mail->isSMTP(); // Set mailer to use SMTP
$mail->Host = 'sg2plcpnl0054.prod.sin2.secureserver.net'; // Specify main and backup SMTP servers
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = '[email protected]'; // SMTP username
$mail->Password = 'random1234rewqA'; // SMTP password
$mail->SMTPSecure = 'ssl'; // Enable TLS encryption, `ssl` also accepted
$mail->Port = 465; // TCP port to connect to
$mail->SMTPOptions = array(
'ssl' => array(
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true
)
);
$mail->From = '[email protected]';
$mail->FromName = $name;
$mail->addAddress('[email protected]', 'Enquiry'); // Add a recipient
$mail->addReplyTo($email, $name);
$mail->Subject = 'Explora enquiry from '.$name;
$mail->Body = $enqq;
if(!$mail->send()) {
//$mail->SMTPDebug=2;
echo 'Message could not be sent.';
// echo 'Mailer Error: ' . $mail->ErrorInfo;
} else {
echo '<script type="text/javascript"> alert("Enquiry Submitted Successfully")</script>';
echo "<script type='text/javascript'>window.location='newenqtext.php'</script>";
}
?>
</body>
</html>