-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcontactus.php
100 lines (85 loc) · 3.23 KB
/
contactus.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<?php
include("header.php");
if(isset($_POST[submit]))
{
$message = "<strong>Dear $_POST[name],</strong><br />
<strong>Your Email ID is :</strong> $_POST[email]<br />
<strong>Message :-</strong> $_POST[comment]
";
sendmail("yashikachinz1997@gmail.com","Mail from Appoint My Doctor",$message);
}
?>
<div class="wrapper col2">
<div id="breadcrumb">
<ul>
<li class="first">Contact Us</li>
</ul>
</div>
</div>
<div class="wrapper col4">
<div id="container">
<h6>Our Address</h6>
<p>
Hospital Management System, Kolkata<br />
<strong>tel</strong>:123 4567890<br />
<strong>Email ID</strong>: hms@gmail.com</p>
<h6>Contact Us by entering following information</h6>
<form action="" method="post">
<p>
<input type="text" name="name" id="name" value="" size="22" />
<label for="name"><small>Name (required)</small></label>
</p>
<p>
<input type="text" name="email" id="email" value="" size="22" />
<label for="email"><small>Mail (required)</small></label>
</p>
<p>
<textarea name="comment" id="comment" cols="100%" rows="10"></textarea>
<label for="comment" style="display:none;"><small>Comment (required)</small></label>
</p>
<p>
<input name="submit" type="submit" id="submit" value="Submit Form" />
<input name="reset" type="reset" id="reset" tabindex="5" value="Reset Form" />
</p>
</form>
</div>
</div>
<div class="clear"></div>
</div>
</div>
<?php
include("footer.php");
function sendmail($toaddress,$subject,$message)
{
require 'PHPMailer-master/PHPMailerAutoload.php';
$mail = new PHPMailer;
//$mail->SMTPDebug = 3; // Enable verbose debug output
$mail->isSMTP(); // Set mailer to use SMTP
$mail->Host = 'mail.dentaldiary.in'; // Specify main and backup SMTP servers
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = 'sendmail@dentaldiary.in'; // SMTP username
$mail->Password = 'q1w2e3r4/'; // SMTP password
$mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted
$mail->Port = 587; // TCP port to connect to
$mail->From = 'sendmail@dentaldiary.in';
$mail->FromName = 'Web Mall';
$mail->addAddress($toaddress, 'Joe User'); // Add a recipient
$mail->addAddress($toaddress); // Name is optional
$mail->addReplyTo('aravinda@technopulse.in', 'Information');
$mail->addCC('cc@example.com');
$mail->addBCC('bcc@example.com');
$mail->addAttachment('/var/tmp/file.tar.gz'); // Add attachments
$mail->addAttachment('/tmp/image.jpg', 'new.jpg'); // Optional name
$mail->isHTML(true); // Set email format to HTML
$mail->Subject = $subject;
$mail->Body = $message;
$mail->AltBody = $subject;
if(!$mail->send()) {
echo 'Message could not be sent.';
echo 'Mailer Error: ' . $mail->ErrorInfo;
} else {
echo '<center><strong><font color=green>Mail sent.</font></strong></center>';
}
}
?>