insert_id;
//Set Email Info
$to = "TO-EMAIL@DOMAIN.COM";
$subject = "New BMS Alert: ".$unitname." ".$alertname."";
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
$headers .= "From: FROM-EMAIL@DOMAIN.COM";
$message = "
BMS Unit: ".$unitname."
Type of Alert: ".$alertname."
Start Date / Time: ".$start_date_time."
End Date / Time: ".$end_date_time."
Description: ".$description_for_email."
Created by: ".$user."
Event Link: https://DOMAIN.COM/bms/viewevent.php?eventid=$event_id
This message generated by https://DOMAIN.COM/bms
";
//WordWrap the message
$message_wrapped = wordwrap($message, 70, "\n", true);
//Send the email
mail($to,$subject,$message_wrapped,$headers);
} else{
echo('Error! Please go back and try again');
}
$conn->close();
?>