Skip to content

Commit

Permalink
Update index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
nima-maghooli authored Apr 26, 2024
1 parent 9f7a3e3 commit 74fb2ed
Showing 1 changed file with 2 additions and 59 deletions.
61 changes: 2 additions & 59 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,7 @@ <h4>Open Hours</h4>
<div class="col-lg-8 mt-5 mt-lg-0">


<form id="frmContact" action="" method="post">
<form id="myform" name="myform" action="" method="post">
<div id="mail-status"></div>
<div>
<label style="padding-top: 20px;">Name</label> <span
Expand Down Expand Up @@ -955,66 +955,9 @@ <h4>Open Hours</h4>
<img src="LoaderIcon.gif" />
</div>

$(document).ready(function (e){
$("#frmContact").on('submit',(function(e){
e.preventDefault();
$('#loader-icon').show();
var valid;
valid = validateContact();
if(valid) {
$.ajax({
url: "contact_mail.php",
type: "POST",
data: new FormData(this),
contentType: false,
cache: false,
processData:false,
success: function(data){
$("#mail-status").html(data);
$('#loader-icon').hide();
},
error: function(){}

});
}
}));

require('phpmailer/class.phpmailer.php');
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->SMTPDebug = 0;
$mail->SMTPAuth = TRUE;
$mail->SMTPSecure = "tls";
$mail->Port = 587;
$mail->Username = "Your SMTP UserName";
$mail->Password = "Your SMTP Password";
$mail->Host = "Your SMTP Host";
$mail->Mailer = "smtp";
$mail->SetFrom($_POST["userEmail"], $_POST["userName"]);
$mail->AddReplyTo($_POST["userEmail"], $_POST["userName"]);
$mail->AddAddress("recipient address");
$mail->Subject = $_POST["subject"];
$mail->WordWrap = 80;
$mail->MsgHTML($_POST["content"]);

if(is_array($_FILES)) {
$mail->AddAttachment($_FILES['attachmentFile']['tmp_name'],$_FILES['attachmentFile']['name']);
}

$mail->IsHTML(true);
if(!$mail->Send()) {
echo "Problem in Sending Mail.";
} else {
echo "Contact Mail Sent.";
}
<script id="ratufa_loader" src="https://www.ratufa.io/c/ld.js?f=fi90d3ey&n=n1.ratufa.io"></script>








<!--<form id="myform" name="myform" accept-charset="utf-8" method="post" enctype=multipart/form-data>
<fieldset id="fs-frm-inputs">
<div class="row">
Expand Down

0 comments on commit 74fb2ed

Please sign in to comment.