documented the sendmail.php script.

This commit is contained in:
Marcel Kapfer 2017-05-23 16:47:16 +02:00
parent cef1650686
commit 53421bcae0
1 changed files with 20 additions and 0 deletions

View File

@ -2,12 +2,22 @@
# COPYRIGHT (c) 2016 Marcel Kapfer (mmk2410)
# MIT License
/**
* configuration map
*/
$ini = parse_ini_file("../../filespread.ini");
date_default_timezone_set($ini["timezone"]);
require '../../vendor/autoload.php';
/**
* main function that is executed at the beginning.
*
* @author Marcel Kapfer <marcelmichaelkapfer@gmail.com>
*
* @param $ini an configuration map.
*/
function main($ini) {
$data = json_decode($_GET["data"], true);
@ -38,6 +48,16 @@ function main($ini) {
}
/**
* function for sending the mail.
*
* @author Marcel Kapfer <marcelmichaelkapfer@gmail.com>
*
* @param $title the subject of the mail.
* @param $content the text of the mail.
* @param $address the receiver of the mail.
* @param $ini an configuration map.
*/
function sendMail($title, $content, $filename, $address, $ini) {
$mail = new PHPMailer;