Sample Scripts for online contact form provided by us :
You can download the sample scripts for contact from from url below:
http://edinburgh.theukhost.net/contact.zipThe above zip file content following Sample code and Class files
contact.php
contact.html
class.phpmailer.php
class.smtp.php.
README
Please refer following steps for implementing the script.
1. Copy all the files in the same folder.
2. Do not make any changes in files class.phpmailer.php and class.smtp.php.
3. Check code in contact.php file and put it into your form action file code. If action file is same
<?php
ob_start();
// File : contact.php //require("class.phpmailer.php");
$mail = new PHPMailer();
// set mailer to use SMTP$mail->IsSMTP();
// specify main and backup server$mail->Host = "smtp1.example.com";
// turn on SMTP authentication$mail->SMTPAuth = true;
// SMTP username$mail->Username = "user@example.com";
$mail->Password = "secret";
$mail->From = $mail->Username;
$mail->FromName = "From Name";
// Email address on which you wish to collect contact information from your site form.// name is optional
$mail->AddAddress("to@example.com", "name");
// User will be redirected to this URL after submitting the form.$redirect_url = "";
// set word wrap to 50 characters$mail->WordWrap = 50;
// set email format to HTML $mail->IsHTML(true);
$mail->Subject = "Here is the subject";
$mail->Body = "Message body";
if(!$mail->Send())
{
echo "Message could not be sent. <p>";
echo "Mailer Error: " . $mail->ErrorInfo;
exit;
}
else
{
echo "Message has been sent";
}
header("Location: $redirect_url");
?>