mirror of
https://git.hexahost.dev/smueller/HexaHost-Frontend.git
synced 2026-06-02 17:58:43 +00:00
Compare commits
32 Commits
v1.4.2
...
f4947d5e25
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f4947d5e25 | ||
|
|
45a7067878 | ||
|
|
4787d7b770 | ||
|
|
a0aa8b12ca | ||
|
|
b113bdeaa2 | ||
|
|
5d2be60dfa | ||
|
|
62d0076799 | ||
|
|
e920fdfc8e | ||
|
|
5d953fda7b | ||
|
|
6ca4786955 | ||
|
|
b9bd339607 | ||
|
|
b893272d64 | ||
|
|
3dd707ab93 | ||
|
|
cc1a48943a | ||
|
|
dfc781f3ed | ||
|
|
d0e5baa443 | ||
|
|
8afba16905 | ||
|
|
96a5977283 | ||
|
|
ec8686761c | ||
|
|
d3da589a1d | ||
|
|
b6e268855e | ||
|
|
d02377c735 | ||
|
|
d62d6b576d | ||
|
|
2c0138f55d | ||
|
|
2074707c9d | ||
|
|
55f9fdd957 | ||
|
|
ab81d1c49f | ||
|
|
b40ad53d9c | ||
|
|
e5402189ea | ||
|
|
e544720900 | ||
| a5bba86db0 | |||
| d34dbbb079 |
@@ -1,48 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* HexaHost.de E-Mail Test (nur CLI oder lokale Entwicklung)
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (PHP_SAPI !== 'cli') {
|
|
||||||
$remoteAddr = $_SERVER['REMOTE_ADDR'] ?? '';
|
|
||||||
$isLocal = in_array($remoteAddr, ['127.0.0.1', '::1'], true)
|
|
||||||
|| filter_var($remoteAddr, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) === false;
|
|
||||||
|
|
||||||
if (!$isLocal) {
|
|
||||||
http_response_code(403);
|
|
||||||
exit('Forbidden');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
require_once __DIR__ . '/../backend/config/mail-config.php';
|
|
||||||
|
|
||||||
function testEmail() {
|
|
||||||
$config = getHexaHostConfig();
|
|
||||||
|
|
||||||
$subject = '[HexaHost.de] Test-E-Mail';
|
|
||||||
$message = "Test-E-Mail von HexaHost.de\n\n";
|
|
||||||
$message .= "Zeitstempel: " . date('d.m.Y H:i:s') . "\n";
|
|
||||||
|
|
||||||
$headers = [
|
|
||||||
'From: ' . $config['from_name'] . ' <' . $config['from_email'] . '>',
|
|
||||||
'MIME-Version: 1.0',
|
|
||||||
'Content-Type: text/plain; charset=UTF-8',
|
|
||||||
'X-Mailer: HexaHost Test Email',
|
|
||||||
];
|
|
||||||
|
|
||||||
return mail($config['to_email'], $subject, $message, implode("\r\n", $headers));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (PHP_SAPI === 'cli') {
|
|
||||||
echo testEmail() ? "Test-E-Mail gesendet.\n" : "Fehler beim Senden.\n";
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isset($_GET['test'])) {
|
|
||||||
echo testEmail()
|
|
||||||
? 'Test-E-Mail wurde gesendet.'
|
|
||||||
: 'Fehler beim Senden der Test-E-Mail.';
|
|
||||||
} else {
|
|
||||||
echo '<h1>HexaHost.de E-Mail Test</h1>';
|
|
||||||
echo '<p><a href="?test=1">Test-E-Mail senden</a></p>';
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user