documented the sendmail.php script.

This commit is contained in:
Marcel Kapfer 2017-05-23 16:47:16 +02:00
parent cef1650686
commit 53421bcae0

View file

@ -2,12 +2,22 @@
# COPYRIGHT (c) 2016 Marcel Kapfer (mmk2410) # COPYRIGHT (c) 2016 Marcel Kapfer (mmk2410)
# MIT License # MIT License
/**
* configuration map
*/
$ini = parse_ini_file("../../filespread.ini"); $ini = parse_ini_file("../../filespread.ini");
date_default_timezone_set($ini["timezone"]); date_default_timezone_set($ini["timezone"]);
require '../../vendor/autoload.php'; 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) { function main($ini) {
$data = json_decode($_GET["data"], true); $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) { function sendMail($title, $content, $filename, $address, $ini) {
$mail = new PHPMailer; $mail = new PHPMailer;