/**
* email function
*
* @return bool | void
**/
function email($to, $from_mail, $from_name, $subject, $message)
{
require '../../PHPMailer/PHPMailerAutoload.php';
$mail = new PHPMailer();
$mail->From = $from_mail;
$mail->FromName = $from_name;
$mail->addAddress($to, $from_name);
// Add a recipient
$mail->addCC('');
//Optional ; Use for CC
$mail->addBCC('');
//Optional ; Use for BCC
$mail->WordWrap = 50;
// Set word wrap to 50 characters
$mail->isHTML(true);
// Set email format to HTML
//Remove below comment out code for SMTP stuff, otherwise don't touch this code.
/*
$mail->isSMTP();
$mail->Host = "mail.example.com"; //Set the hostname of the mail server
$mail->Port = 25; //Set the SMTP port number - likely to be 25, 465 or 587
$mail->SMTPAuth = true; //Whether to use SMTP authentication
$mail->Username = "******"; //Username to use for SMTP authentication
$mail->Password = "******"; //Password to use for SMTP authentication
*/
$mail->Subject = $subject;
$mail->Body = $message;
if ($mail->send()) {
return true;
}
}