From 996d4c50dd0a4adef9bed6426266a26bb3355e0c Mon Sep 17 00:00:00 2001 From: joethei Date: Wed, 21 Apr 2021 10:17:02 +0200 Subject: [PATCH] start connection to db and mail server --- .gitignore | 4 +- composer.json | 5 ++ composer.lock | 95 ++++++++++++++++++++++++++++++++++++ general.php | 17 ++++++- index.php | 133 ++++++++++++++++++++++++-------------------------- overview.php | 9 +++- submit.php | 30 ++++++++++++ 7 files changed, 219 insertions(+), 74 deletions(-) create mode 100644 composer.json create mode 100644 composer.lock create mode 100644 submit.php diff --git a/.gitignore b/.gitignore index 723ef36..3507b38 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ -.idea \ No newline at end of file +.idea +config.ini.php +vendor \ No newline at end of file diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..79d77c4 --- /dev/null +++ b/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "phpmailer/phpmailer": "^6.4" + } +} diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..359230a --- /dev/null +++ b/composer.lock @@ -0,0 +1,95 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "d01b4a542231b112db557e6b7e5a5121", + "packages": [ + { + "name": "phpmailer/phpmailer", + "version": "v6.4.0", + "source": { + "type": "git", + "url": "https://github.com/PHPMailer/PHPMailer.git", + "reference": "050d430203105c27c30efd1dce7aa421ad882d01" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/050d430203105c27c30efd1dce7aa421ad882d01", + "reference": "050d430203105c27c30efd1dce7aa421ad882d01", + "shasum": "" + }, + "require": { + "ext-ctype": "*", + "ext-filter": "*", + "ext-hash": "*", + "php": ">=5.5.0" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", + "doctrine/annotations": "^1.2", + "phpcompatibility/php-compatibility": "^9.3.5", + "roave/security-advisories": "dev-latest", + "squizlabs/php_codesniffer": "^3.5.6", + "yoast/phpunit-polyfills": "^0.2.0" + }, + "suggest": { + "ext-mbstring": "Needed to send email in multibyte encoding charset or decode encoded addresses", + "hayageek/oauth2-yahoo": "Needed for Yahoo XOAUTH2 authentication", + "league/oauth2-google": "Needed for Google XOAUTH2 authentication", + "psr/log": "For optional PSR-3 debug logging", + "stevenmaguire/oauth2-microsoft": "Needed for Microsoft XOAUTH2 authentication", + "symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)" + }, + "type": "library", + "autoload": { + "psr-4": { + "PHPMailer\\PHPMailer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-2.1-only" + ], + "authors": [ + { + "name": "Marcus Bointon", + "email": "phpmailer@synchromedia.co.uk" + }, + { + "name": "Jim Jagielski", + "email": "jimjag@gmail.com" + }, + { + "name": "Andy Prevost", + "email": "codeworxtech@users.sourceforge.net" + }, + { + "name": "Brent R. Matzelle" + } + ], + "description": "PHPMailer is a full-featured email creation and transfer class for PHP", + "support": { + "issues": "https://github.com/PHPMailer/PHPMailer/issues", + "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.4.0" + }, + "funding": [ + { + "url": "https://github.com/Synchro", + "type": "github" + } + ], + "time": "2021-03-31T20:06:42+00:00" + } + ], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [], + "plugin-api-version": "2.0.0" +} diff --git a/general.php b/general.php index 9684f52..91af68c 100644 --- a/general.php +++ b/general.php @@ -1,16 +1,31 @@ Alumni Max Emden - + + + + -
-
-
-
- Logo Max-Windmüller Gymnasium -
-
- Beschreibender Text -
-
- -
-
- -
- - +
+
+
+
+
+
+
+ Logo Max-Windmüller Gymnasium +
+
-
- - -
+

-
- - +
+ +
+ + +
+ +
+ + -
+ for ($i = 1970; $i < date("Y"); $i++) { + ?> + + + +
+
+ + " max="" class="form-input"> +
-
- - -
- -
- - -
+
-
- -
+
+ +
- -
+ +
- - +
+
-
+ +
@@ -37,6 +39,9 @@ if ($entries === null) { diff --git a/submit.php b/submit.php new file mode 100644 index 0000000..4c9d0f6 --- /dev/null +++ b/submit.php @@ -0,0 +1,30 @@ +Host = $config['mail_server']; +$mail->Port = $config['mail_port']; +$mail->Username = $config['mail_user']; +$mail->Password = $config['mail_password']; + +$mail->From = $config['mail_address']; +$mail->FromName = 'Mailer'; +$mail->addAddress('test@joethei.de', 'Joe User'); + +$mail->Subject = 'Here is the subject'; +$mail->Body = 'This is the HTML message body in bold!'; + + +try { + !$mail->send(); +} catch (\PHPMailer\PHPMailer\Exception $e) { + echo $e; +}