-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontact.php
53 lines (47 loc) · 3.76 KB
/
contact.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
<?php
$post = $_POST;
if (isset($post['contact_name']) && $post['contact_email'] && isset($post['contact_subject']) && $post['contact_message']) {
$message = '<table align="center" border="0" cellpadding="0" cellspacing="0" height="100%" width="100%" style="background-color: #F4F4F4; border-bottom: 1px solid #CCCCCC;">
<tr> <td align="center" valign="top" style="background-color: #F4F4F4; border-top: 1px solid #FFFFFF; border-bottom: 1px solid #CCCCCC;">
<table border="0" cellpadding="0" cellspacing="0" style="border: 1px solid #BBBBBB; width: 600px;">
<tr> <td align="center" valign="top">
<table border="0" cellpadding="0" cellspacing="0" width="100%" style="background-color: #F4F4F4; border-bottom: 1px solid #CCCCCC;">
<tr> <td valign="top" style="color: #808080; font-family: Helvetica; font-size: 10px; line-height: 125%; text-align:center; padding-top:10px; padding-right:20px; padding-bottom:10px; padding-left:0;" mc:edit="preheader_content01"> Email not displaying correctly? <a href="#" target="_blank">View it in your browser</a>. </td></tr>
</table> </td></tr>
<tr> <td align="center" valign="top">
<table border="0" cellpadding="0" cellspacing="0" width="100%" style="background-color:#ffffff; border-top:1px solid #FFFFFF; border-bottom:1px solid #CCCCCC;">
<tr> <td valign="top" style="text-align:center; color:#505050;font-family:Helvetica;font-size:20px;font-weight:700;line-height:100%;vertical-align:middle; padding:10px;"> <img src="http://caper.ly/beta/img/Caper.png" style="max-width:600px; max-height: 50px;" id="headerImage" mc:label="header_image" mc:edit="header_image" mc:allowdesigner mc:allowtext/> </td></tr>
</table> </td></tr>
<tr> <td align="center" valign="top">
<table border="0" cellpadding="0" cellspacing="0" width="100%" style="padding-bottom:20px; background-color:#ffffff;border-top:1px solid #FFF;border-bottom:1px solid #CCC">
<tr> <td valign="top" class="bodyContent" style="padding-left:20px;" mc:edit="body_content"> <h1>Contact Enquiry</h1> </td></tr>
<tr><td style="width:100%; padding:10px 20px 40px">
<table cellpadding="10" cellspacing="0" width="100%" style="border:1px solid #ccc;line-height:24px; font-size:16px; font-family: Helvetica;">
<tr><td width="30%" bgcolor="#ebebeb">Name: </td><td bgcolor="#f6f6f6">' . $post['contact_name'] . '</td></tr>
<tr><td bgcolor="#ebebeb">Email Id: </td><td bgcolor="#f6f6f6">' . $post['contact_email'] . '</td></tr>
<tr><td bgcolor="#f8f8f8">Subject: </td><td bgcolor="#fff">' . $post['contact_subject'] . '</td></tr>
<tr><td bgcolor="#ebebeb">Message: </td><td bgcolor="#f6f6f6">' . $post['contact_message'] . '</td></tr>
</table></td></tr></table> </td></tr>
<tr> <td align="center" valign="top"> <table border="0" cellpadding="0" cellspacing="0" width="100%" style="background-color:#F4F4F4; border-top:1px solid #FFFFFF;"><tr><td valign="top" style="text-align:center; color:grey;font-family:Helvetica;font-size:10px;line-height:150%;padding:20px" mc:edit="footer_content01"><em>Copyright © 2016 Caper, All rights reserved.</em></td></tr>
</table> </td></tr></table> </td></tr></table>';
require_once('PHPMailer/class.phpmailer.php');
$mail = new PHPMailer();
$mail->isSMTP();
//For loaclhost
/* $mail->SMTPAuth = true;
$mail->SMTPSecure = 'ssl';
$mail->Host = 'smtp.googlemail.com';
$mail->Port = 465;
$mail->Username = "[email protected]"; // GMAIL username
$mail->Password = "prabhukiran510"; */
$mail->SetFrom($post['contact_email'], $post['contact_name']);
$mail->AddAddress('[email protected]'); //
$mail->Subject = "Caper - Contact Enquiry";
$mail->MsgHTML($message);
$mail->Send();
/* if(!$mail->Send())
echo $mail->ErrorInfo;
else */
echo "Thanks for contacting Caper!<br/> We'll get back to you as soon as we can.";
}
?>