Sunday, July 22, 2012

SMTP Feedback Mail class with jQuery Slide Effect.

This post about feedback mail with nice slide effect using php SMTP class and jQuery. It's very useful to add your php websites as like contact/feedback page.
I have downloaded this SMTP class from phpclasses.org. Include with jQuery Slide effect just you have to upload these files into hosting server.

Feedback page with slide effect.


Download Script     Live Demo

You have to add this jquery script in feedback.php:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/
1.3.0/jquery.min.js">type="text/javascript" </script>
 
<script type="text/javascript">
$(document).ready(function(){
 
 $(".button-slide").click(function(){

  $("#board").slideToggle("slow");
  $(this).toggleClass("active"); return false;

 });
  
});
</script>
feedback.php
Contains simple PHP and HTML script. You have to change feedback email id.
<?php
require ("smtpclass.php");
if($_SERVER["REQUEST_METHOD"] == "POST")
 {
$smtp=new SMTPMAIL;

$from=$_POST['email']; 
$body=$_POST['msg']; 
$to="Admin<admin@domain.com>";

$cc="";
$subject="Feedback Mail";
 
  if(!$smtp->send_smtp_mail($to,$subject,$body,$cc,$from))

 $error="Error in sending mail!<BR>Error: ".$smtp->error;
  else
 $report="Mail sent succesfully!";
}
?>
<div style="display: none;" id="board" align="center"><br />
<form id="form1" name="form1" method="post" action="">

  Your Email : <input type="text" name="email" size="25"/>
  Message :<textarea name="msg"  rows="5" cols="23"></textarea>

  <input type="submit" value=" Send " />
  <?php echo $report; echo $error; ?>

  </form></div>
<div align="center"><a href="#" class="button-slide">
Feedback </a></div>

SMTPclass.php
Upload this file into your hosting space. No need to touch this code it's automatically detects your website SMTP mail address.

Download Script

CSS Code :
Include this CSS code in feedback.php.
#board {
  background:#dedede;
 height: 205px;display: none;
  width: 300px;border-bottom: solid 4px #006699;
  position:absolute;
 }
.button-slide {
 text-align: center;background-color:#006699;
  width: 94px;height: 21px;
  padding: 6px 6px 0 0;margin: 0 auto;display: block;
  font: bold 120%/100% Arial, Helvetica, sans-serif;
  color: #fff;text-decoration: none;
 position:fixed;
}
Download Script     Live Demo
Note : I was hosting my demos is 110mb.com. Its a free php hosting area they are not providing any SMTP support.

4 comments:

Anonymous said...

Hello, just wanted to mention, I enjoyed thiѕ blog
ρoѕt. It was funnу. Keеp on posting!


My homepage: Website hosting hampshire

Anonymous said...

I viѕiteԁ multiρlе web pagеs excеpt the audio quality fοr audio songѕ currеnt at thiѕ ωeb ρage is genuinely
wοnderful.

Feel frеe to visit my wеb blоg; outsourced seo

Anonymous said...

ӏ am sure this paragraph has touched аll the internet ѵiewers, its reаlly rеally nice artiсlе on
builԁing up nеw web site.

my blog; Theme Hospital Patch

Anonymous said...

Niсe post. I was chеcking continuously this blog аnd Ӏ am impresseԁ!
Very useful infoгmation sρecially the lаst paгt :
) I caгe foг such info much. Ι was looking for
thіs ρartiсular infoгmation foг a veгy lοng tіme.
Thank you anԁ goοd luсk.

Fеel fгee to surf to my web blog: Drug Rehab Facility