include "class.phpmailer.php";
$to = $_REQUEST['email'];
$from = "reports@myenergybalance.com";
$mail = new PHPMailer(true);
try {
$mail->SetFrom($from, $from);
$mail->AddAddress($to, '');
// $mail->AddAddress('test@isisdsn.net', 'Administrator'); for multiple receivers
$mail->Subject = $_REQUEST['sub']."(".$_SESSION['date'].")";
//$mail->AltBody = $message; // optional - MsgHTML will create an alternate automatically
$message = $_REQUEST['body'];
$mail->MsgHTML($message);
$filename=$_SERVER['DOCUMENT_ROOT'].'/demos/myenergybalance/MyEnergyBalance/website/screen/filereportall'.$_SESSION['userid'].'.png';
$mail->AddAttachment($filename);
$mail->Send();
$msg="Message Sent OK\n";
}catch (phpmailerException $e) {
echo $e->errorMessage(); //Pretty error messages from PHPMailer
} catch (Exception $e) {
echo $e->getMessage(); //Boring error messages from anything else!
}
$to = $_REQUEST['email'];
$from = "reports@myenergybalance.com";
$mail = new PHPMailer(true);
try {
$mail->SetFrom($from, $from);
$mail->AddAddress($to, '');
// $mail->AddAddress('test@isisdsn.net', 'Administrator'); for multiple receivers
$mail->Subject = $_REQUEST['sub']."(".$_SESSION['date'].")";
//$mail->AltBody = $message; // optional - MsgHTML will create an alternate automatically
$message = $_REQUEST['body'];
$mail->MsgHTML($message);
$filename=$_SERVER['DOCUMENT_ROOT'].'/demos/myenergybalance/MyEnergyBalance/website/screen/filereportall'.$_SESSION['userid'].'.png';
$mail->AddAttachment($filename);
$mail->Send();
$msg="Message Sent OK\n";
}catch (phpmailerException $e) {
echo $e->errorMessage(); //Pretty error messages from PHPMailer
} catch (Exception $e) {
echo $e->getMessage(); //Boring error messages from anything else!
}