Note: **
Hi Guys: 1st you change the name of your Username & Password then change the From().
you change the AddAddress where you are send the email address .
1.if you have a forum then you want to send the mail then you change the addaddress() mail id.
2.If you want to user fill the forum and send the message you then you fill the him mail id .
2.If you want to user fill the forum and send the message you then you fill the him mail id .
In Body $mail->Body = ""; you can change accourding your message. i give you a simple forum & you can see the output in down
require("PHPMailer_5.2.0/class.phpmailer.php");
if(isset($_POST['submit'])){
$you_looking = $_POST['you_looking'];
$name = $_POST['name'];
$email = $_POST['email'];
$eventtype = $_POST['eventtype'];
$city = $_POST['city'];
$phone = $_POST['phone'];
$date = $_POST['date'];
$guests = $_POST['guests'];
$message = $_POST['message'];
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->Host = "mail.bluefox.agency";
$mail->SMTPAuth = true;
$mail->Username = "codeerfunda@blue.agency";
$mail->Password = "test@jk";
$mail->From = "codeerfunda@codeer.agency";
$mail->FromName = "Codeerfunda";
$mail->AddAddress('codeerfunda@gmail.com');
$mail->WordWrap = 50;
$mail->IsHTML(true);
$mail->Subject = "App Installation Link";
$mail->Body = "<!DOCTYPE html> <html> <head> <title>Invoice</title> <link href='https://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet'> <link href='https://fonts.googleapis.com/css?family=News+Cycle:700' rel='stylesheet'> </head> <body> <table width='500' align='center' cellpadding='0' cellspacing='0' style='margin: auto;'> <tr> <td> <table align='center' width='500' cellpadding='0' cellspacing='0' border='0' style='background: #000;border: 1px solid #dddddd;'> <tr><td height='15' align='center'></td></tr> <tr> <td width='100%' align='center'> <a href='#'> <img src='http://bluefox.agency/images/logo.png' style='display: block;width: 200px;'> </a> </td> </tr> <tr><td height='15' align='center'></td></tr> </table> <table style='border-collapse:collapse;width:100%;border-top:1px solid #dddddd;border-left:1px solid #dddddd;margin-bottom:20px'> <tbody> <tr> <td style='font-family: Open Sans,sans-serif;font-size:14px;border-right:1px solid #dddddd;border-bottom:2px solid #dddddd;padding:12px;text-transform: uppercase;font-weight: 600;font-family: -apple-system,Helvetica,Arial,sans-serif;color: #000; width: 150px;'>You are looking for</td> <td style='font-family: Open Sans, sans-serif;font-size:14px;border-right:1px solid #dddddd;border-bottom:1px solid #dddddd;text-align:left;padding:7px'>".$you_looking."</td> </tr><tr> <td style='font-family: Open Sans, sans-serif;font-size:14px;border-right:1px solid #dddddd;border-bottom:2px solid #dddddd;padding:12px;text-transform: uppercase;font-weight: 600;font-family: -apple-system,Helvetica,Arial,sans-serif;color: #000; width: 150px;'>Company / Institution</td> <td style='font-family: Open Sans, sans-serif;font-size:14px;border-right:1px solid #dddddd;border-bottom:1px solid #dddddd;text-align:left;padding:7px'>".$name."</td> </tr> <tr> <td style='font-family: Open Sans, sans-serif;font-size:14px;border-right:1px solid #dddddd;border-bottom:2px solid #dddddd;padding:12px;text-transform: uppercase;font-weight: 600;font-family: -apple-system,Helvetica,Arial,sans-serif;color: #000; width: 150px;'>Company / Institution</td> <td style='font-family: Open Sans, sans-serif;font-size:14px;border-right:1px solid #dddddd;border-bottom:1px solid #dddddd;text-align:left;padding:7px'>".$company."</td> </tr> <tr> <td style='font-family: Open Sans, sans-serif;font-size:14px;border-right:1px solid #dddddd;border-bottom:2px solid #dddddd;padding:12px;text-transform: uppercase;font-weight: 600;font-family: -apple-system,Helvetica,Arial,sans-serif;color: #000; width: 150px;'>Email</td> <td style='font-family: Open Sans, sans-serif;font-size:14px;border-right:1px solid #dddddd;border-bottom:1px solid #dddddd;text-align:left;padding:7px'>".$email."</td> </tr> <tr> <td style='font-family: Open Sans, sans-serif;font-size:14px;border-right:1px solid #dddddd;border-bottom:2px solid #dddddd;padding:12px;text-transform: uppercase;font-weight: 600;font-family: -apple-system,Helvetica,Arial,sans-serif;color: #000; width: 150px;'>Phone number *</td> <td style='font-family: Open Sans, sans-serif;font-size:14px;border-right:1px solid #dddddd;border-bottom:1px solid #dddddd;text-align:left;padding:7px'>".$phone."</td> </tr> <tr> <td style='font-family: Open Sans, sans-serif;font-size:14px;border-right:1px solid #dddddd;border-bottom:2px solid #dddddd;padding:12px;text-transform: uppercase;font-weight: 600;font-family: -apple-system,Helvetica,Arial,sans-serif;color: #000; width: 150px;'>City</td> <td style='font-family: Open Sans, sans-serif;font-size:14px;border-right:1px solid #dddddd;border-bottom:1px solid #dddddd;text-align:left;padding:7px'>".$city."</td> </tr> <tr> <td style='font-family: Open Sans, sans-serif;font-size:14px;border-right:1px solid #dddddd;border-bottom:2px solid #dddddd;padding:12px;text-transform: uppercase;font-weight: 600;font-family: -apple-system,Helvetica,Arial,sans-serif;color: #000; width: 150px;'>Event Location</td> <td style='font-family: Open Sans, sans-serif;font-size:14px;border-right:1px solid #dddddd;border-bottom:1px solid #dddddd;text-align:left;padding:7px'>".$location."</td> </tr> <tr> <td style='font-family: Open Sans, sans-serif;font-size:14px;border-right:1px solid #dddddd;border-bottom:2px solid #dddddd;padding:12px;text-transform: uppercase;font-weight: 600;font-family: -apple-system,Helvetica,Arial,sans-serif;color: #000; width: 150px;'>Date of the event </td> <td style='font-family: Open Sans, sans-serif;font-size:14px;border-right:1px solid #dddddd;border-bottom:1px solid #dddddd;text-align:left;padding:7px'>".$date."</td> </tr> <tr> <td style='font-family: Open Sans, sans-serif;font-size:14px;border-right:1px solid #dddddd;border-bottom:2px solid #dddddd;padding:12px;text-transform: uppercase;font-weight: 600;font-family: -apple-system,Helvetica,Arial,sans-serif;color: #000; width: 150px;'>Event Type </td> <td style='font-family: Open Sans, sans-serif;font-size:14px;border-right:1px solid #dddddd;border-bottom:1px solid #dddddd;text-align:left;padding:7px'>".$eventtype."</td> </tr><tr> <td style='font-family: Open Sans, sans-serif;font-size:14px;border-right:1px solid #dddddd;border-bottom:2px solid #dddddd;padding:12px;text-transform: uppercase;font-weight: 600;font-family: -apple-system,Helvetica,Arial,sans-serif;color: #000; width: 150px;'>Number of Guests </td> <td style='font-family: Open Sans, sans-serif;font-size:14px;border-right:1px solid #dddddd;border-bottom:1px solid #dddddd;text-align:left;padding:7px'>".$guests."</td> </tr><tr> <td style='font-family: Open Sans, sans-serif;font-size:14px;border-right:1px solid #dddddd;border-bottom:2px solid #dddddd;padding:12px;text-transform: uppercase;font-weight: 600;font-family: -apple-system,Helvetica,Arial,sans-serif;color: #000; width: 150px;'>Event Details * </td> <td style='font-family: Open Sans, sans-serif;font-size:14px;border-right:1px solid #dddddd;border-bottom:1px solid #dddddd;text-align:left;padding:7px'>".$message."</td> </tr> </tbody> </table> </td> </tr> </table> </body> </html> ";
if(!$mail->Send())
{
echo "Message could not be sent.";
echo "Mailer Error: " . $mail->ErrorInfo;
exit;
}
else
{
echo "success";
exit;
}
//echo ('action.php');
//include('inquiry.php');
}
?>
OutPut :>>>
|
Jquery Validation :
<script src="js/common_scripts.min.js"></script>
<script src="js/functions.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-form-validator/2.3.26/jquery.form-validator.min.js"></script>
<script src="https://cdn.jsdelivr.net/jquery.validation/1.15.1/jquery.validate.min.js" type="text/javascript" charset="utf-8" async defer></script>
<script src="js/messages_es.js"></script>
<script src="js/jquery.validate.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#commentForm").validate({
rules: {
vname: {
required: true,
},
vcompany: {
required: true,
},
vemail: {
required: true,
email: true,
},
vphone: {
required: true,
number: true,
minlength: 10,
maxlength: 11,
},
vcity: {
required: true,
},
vlocation: {
required: true,
number: true,
},
vdate: {
required: true,
},
veventtype: {
required: true,
},
vguests: {
required: true,
},
vmessage: {
required: true,
},
},
vmessages: {
vname: {
required: "Enter Name",
},
vcompany: {
required: "Enter company Name",
},
vemail: {
required: "Enter Email Address",
email: "Enter Valid Email Address",
},
vphone: {
required: "Enter Your Mobile Number",
},
vcity: {
required: "Enter Your city",
},
vlocation : {
required: "Enter Your Event Location",
},
vdate: {
required: "Enter Your date",
},
veventtype: {
required: "Enter Your eventtype",
},
vguests: {
required: "Enter Your guests",
},
vmessage: {
required: "Enter Your Message",
},
},submitHandler: function (form) {
$.post('book-sound-lights-projector.php?submit=add',$('#commentForm').serialize(),function(data)
{
if(data == "success")
{
/*$("#commentForm")[0].reset()*/;
swal("Success Message Title", "Well done, you pressed a button", "success");
setTimeout(function () {
window.location.href = 'https://bluefox.agency/book-sound-lights-projector.php'; //Will take you to Google.
}, 2500);
}
else
{
error("Error Message Title", "Unsubmitted data", "success");
}
})
}
}
);
});
</script>
Note :1. #commentForm this is a id use in html form.
2. swal("Success Message Title", "Well done, you pressed a button", "success");
this is a popup window. when you click the send button then use and show th message send.
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
HTML
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Book Sound, Lights, Projector, Stage, LED Etc For Your Event</title>
<?php include 'top.php'?>
<link href="css/vendors.css" rel="stylesheet">
<style type="text/css">
.nice-select{display: none !important;}
select{
display: block !important;
border-radius: 0px 5px 5px 0px;
border: 1px solid #eee;
margin-bottom: 15px;
width: 87%;
height: 40px;
float: left;
padding: 0px 15px;
}
</style>
</head>
<body>
<?php include 'header.php'?>
<div class="container-flude">
<div class="row">
<div class="bg_img2 col-lg-12 col-md-12 col-sm-12 col-xs-12">
<div class="overlayer-search">
<div class="container">
<div class="row">
<h2 class="art-searchsty">Let us book logistics on your behalf. We’ll source you the best logistics in Affordable price!</h2>
<div class="btn_125211">
<a href="#" onclick="window.history.go(-1)">
<i class="fa fa-long-arrow-left" aria-hidden="true"></i> go to previous page
</a>
</div>
</div>
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<form class="inquiry-form" id="commentForm" method="post">
<div class="contentform">
<div id="sendmessage"> Your message has been sent successfully. Thank you. </div>
<div class="form-group">
<p>You are looking for <span>*</span></p>
<span class="icon-case"><i class="fa fa-eye"></i></span>
<select name="you_looking" style="width: 94%">
<option selected hidden></option>
<option>Sound</option>
<option>Lights</option>
<option>Stage</option>
<option>Led</option>
<option>Projector</option>
<option>Others</option>
</select>
<div class="validation"></div>
</div>
<div class="leftcontact">
<div class="form-group">
<p>Your Name <span>*</span></p>
<span class="icon-case"><i class="fa fa-user"></i></span>
<input type="text" name="name">
<div class="validation"></div>
</div>
<div class="form-group">
<p>E-mail Address<span>*</span></p>
<span class="icon-case"><i class="fa fa-envelope-o"></i></span>
<input type="email" name="email">
<div class="validation"></div>
</div>
<div class="form-group">
<p>Event Type <span>*</span></p>
<span class="icon-case"><i class="fa fa-glass"></i></span>
<select name="eventtype" style="display: block !important;">
<option selected hidden></option>
<option>Social</option>
<option>Corporate</option>
<option>Party</option>
<option>Exhibition</option>
<option>Etc</option>
</select>
<div class="validation"></div>
</div>
</div>
<div class="rightcontact">
<div class="form-group">
<p>Your City <span>*</span></p>
<span class="icon-case"><i class="fa fa-building-o"></i></span>
<input type="text" name="city">
<div class="validation"></div>
</div>
<div class="form-group">
<p>Phone number <span>*</span></p>
<span class="icon-case"><i class="fa fa-phone"></i></span>
<input type="text" name="phone">
<div class="validation"></div>
</div>
<div class="form-group">
<p>Date of the event <span>*</span></p>
<span class="icon-case"><i class="fa fa-calendar"></i></span>
<input type="text" name="date" id="booking_date" data-lang="en" data-min-year="2018" data-max-year="2028" data-disabled-days="10/17/2017,11/18/2017">
<div class="validation"></div>
</div>
</div>
<div class="form-group">
<p>Number of Guests <span>*</span></p>
<span class="icon-case"><i class="fa fa-sort-numeric-asc"></i></span>
<select name="guests" style="width: 94%">
<option selected="" hidden=""></option>
<option>1 - 100</option>
<option>101 - 300</option>
<option>301 - 500</option>
<option>501 - 1000</option>
</select>
<div class="validation"></div>
</div>
<div class="form-group">
<span class="icon-case"><i class="fa fa-comments-o"></i></span>
<textarea name="message" rows="14" placeholder="Write us more about the event so that we can offer you the best possible price and source you the best thing" style="padding: 5px 15px"></textarea>
<div class="validation"></div>
</div>
</div>
<button class="bouton-contact btn-hvr-44" type="submit" id="sweet_alert_success" name="submit" value="submit"><span>Send My Request</span></button>
</form>
</div>
</div>
</div>
</div>
</div>
<div class="sec-bannerbg col-lg-12 col-md-12 col-sm-12 col-xs-12">
<div class="container">
<div class="row">
<div class="banner-secadv" style="text-align: center;">
<img src="images/addbanner.png">
</div>
</div>
</div>
</div>