forked from amah/kummerkasten-php
mail_fixes #1
3 changed files with 28 additions and 16 deletions
|
|
@ -23,10 +23,10 @@ $lang = $_GET['lang'];
|
|||
<header class="header">
|
||||
<nav class="header-inner">
|
||||
<div class="header-top">
|
||||
<a class="header-element" href="https://www.fs-infmath.uni-kiel.de/wiki/Hauptseite">
|
||||
<a class="header-element" href="https://www.fs-informatik.uni-kiel.de/">
|
||||
<img src="logo.svg">
|
||||
</a>
|
||||
<a class="header-element" href="https://www.fs-infmath.uni-kiel.de/kummerkasten/">
|
||||
<a class="header-element" href="https://www.fs-informatik.uni-kiel.de/kummerkasten/">
|
||||
<h1 id="title"><?php echo $title; ?></h1>
|
||||
</a>
|
||||
</div>
|
||||
|
|
@ -37,8 +37,8 @@ $lang = $_GET['lang'];
|
|||
<?php echo str_replace("{support_mail}", "<a href=\"mailto:technik@fs-infmath.uni-kiel.de\">technik@fs-infmath.uni-kiel.de</a>", $about); ?>
|
||||
</span>
|
||||
</p>
|
||||
<p><a href="https://www.fs-infmath.uni-kiel.de/wiki/Hauptseite" id="go_back"
|
||||
<p><a href="https://www.fs-informatik.uni-kiel.de/" id="go_back"
|
||||
class="link-button"><?php echo $go_back; ?></a></p>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
||||
|
|
|
|||
28
index.php
28
index.php
|
|
@ -1,5 +1,4 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<?php
|
||||
$lang = $_GET['lang'] ?? $lang = "de";
|
||||
|
|
@ -14,9 +13,19 @@ $go_back = $text["go_back"];
|
|||
$recipient = $text["recipient"];
|
||||
|
||||
if (isset($_POST["submit"])) {
|
||||
$subject = "[Kummerkasten] " . $_POST["subject"];
|
||||
$message = $_POST["message"];
|
||||
if (mail($recipient, $subject, $message)) {
|
||||
$subject = mb_encode_mimeheader(
|
||||
"[Kummerkasten] " . $_POST["subject"],
|
||||
"UTF-8",
|
||||
"Q"
|
||||
);
|
||||
$message = wordwrap($_POST["message"], 77, " \r\n"); // see rfc5322 section-2.1.1
|
||||
|
||||
$headers = [
|
||||
"Content-Transfer-Encoding" => "binary",
|
||||
"Content-Type" => 'text/plain; charset="UTF-8"; format="flowed"',
|
||||
];
|
||||
|
||||
if (mail($recipient, $subject, $message, $headers)) {
|
||||
header("Location: success.php?lang=$lang");
|
||||
} else {
|
||||
header("Location: failed.php?lang=$lang");
|
||||
|
|
@ -24,6 +33,7 @@ if (isset($_POST["submit"])) {
|
|||
die();
|
||||
}
|
||||
?>
|
||||
<html lang="<?php echo $lang; ?>">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
|
|
@ -41,22 +51,24 @@ if (isset($_POST["submit"])) {
|
|||
<a class="header-element" href="https://fs-informatik.uni-kiel.de/">
|
||||
<img src="logo.svg">
|
||||
</a>
|
||||
<a class="header-element" href="https://www.fs-infmath.uni-kiel.de/kummerkasten/">
|
||||
<a class="header-element" href="https://www.fs-informatik.uni-kiel.de/kummerkasten/">
|
||||
<h1 id="title"><?php echo $title; ?></h1>
|
||||
</a>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
<p id="about" class="infobox"><?php echo $about; ?></p>
|
||||
<form action="<?php echo $_SERVER["PHP_SELF"] . '?' . http_build_query($_GET); ?>" method="post">
|
||||
<form action="<?php echo $_SERVER["PHP_SELF"] .
|
||||
"?" .
|
||||
http_build_query($_GET); ?>" method="post" accept-charset="UTF-8">
|
||||
<input type="text" id="subject" name="subject" placeholder="<?php echo $subject_placeholder; ?>"></input>
|
||||
<textarea id="message" name="message" placeholder="<?php echo $message_placeholder; ?>" rows="15"></textarea>
|
||||
<button class="btn btn-primary" type="submit" name="submit"><?php echo $send_button; ?></button>
|
||||
</form>
|
||||
<p>
|
||||
<a href="https://www.fs-infmath.uni-kiel.de/wiki/Hauptseite" id="go_back"
|
||||
<a href="https://www.fs-informatik.uni-kiel.de/" id="go_back"
|
||||
class="link-button"><?php echo $go_back; ?></a>
|
||||
</p>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -23,18 +23,18 @@ $lang = $_GET['lang'];
|
|||
<header class="header">
|
||||
<nav class="header-inner">
|
||||
<div class="header-top">
|
||||
<a class="header-element" href="https://www.fs-infmath.uni-kiel.de/wiki/Hauptseite">
|
||||
<a class="header-element" href="https://www.fs-informatik.uni-kiel.de/">
|
||||
<img src="logo.svg">
|
||||
</a>
|
||||
<a class="header-element" href="https://www.fs-infmath.uni-kiel.de/kummerkasten/">
|
||||
<a class="header-element" href="https://www.fs-informatik.uni-kiel.de/kummerkasten/">
|
||||
<h1 id="title"><?php echo $title; ?></h1>
|
||||
</a>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
<p id="about" class="infobox success"><?php echo $about; ?></p>
|
||||
<p><a href="https://www.fs-infmath.uni-kiel.de/wiki/Hauptseite" id="go_back"
|
||||
<p><a href="https://www.fs-informatik.uni-kiel.de/" id="go_back"
|
||||
class="link-button"><?php echo $go_back; ?></a></p>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue