include "class.phpmailer.php";
include "class.smtp.php";
function send_mail($from,$to,$subject,$message,$AltBody,$name,$host_smtp,$username,$password)
{
$mail = new PHPMailer();
$mail->IsSMTP(); // set mailer to use SMTP
$mail->Host = $host_smtp; // specify main and backup server
$mail->Port = 465; // set the port to use
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->SMTPSecure = 'ssl';
//$mail->Username = $username; // your SMTP username or your gmail username
//
//$mail->Password = $password; // your SMTP password or your gmail password
$mail->Username = $username;
$mail->Password = $password; // your SMTP password or your gmail password
$from = $from; // Reply to this email
$to=$to; // Recipients email ID
$name=$name; // Recipient's name
$mail->From = $from;
$mail->FromName = $name; // Name to indicate where the email came from when the recepient received
$mail->AddAddress($to,"");
$mail->AddReplyTo($from,$from);
$mail->WordWrap = 50; // set word wrap
$mail->IsHTML(true); // send as HTML
$mail->Subject = $subject;
$mail->Body = $message; //HTML Body
$mail->AltBody = $AltBody; //Text Body
$mail->SMTPDebug = 1;
if($mail->Send()) {return true;} else { return false;}
}
?>