From 13ee9440b88e963b586554aa81f9234d071e9aab Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sat, 12 Apr 2025 14:52:21 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A7=20Put=20temporarily=20the=20mail?= =?UTF-8?q?=20function=20in=20lib.php?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel/lib.php | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/kernel/lib.php b/kernel/lib.php index f14baf9..32f35c0 100644 --- a/kernel/lib.php +++ b/kernel/lib.php @@ -289,4 +289,40 @@ function display($content, $title, $topnav=true, $leftnav=true, $rightnav=true, } +function mymail($to, $title, $body, $from = '') { // thanks to arto dot PLEASE dot DO dot NOT dot SPAM at artoaaltonen dot fi. + + $controlquery = doquery("SELECT * FROM {{table}} WHERE id='1' LIMIT 1", "control"); + $controlrow = mysqli_fetch_array($controlquery); + extract($controlrow); + + + $from = trim($from); + + if (!$from) { + $from = '<'.$controlrow["adminemail"].'>'; + } + + $rp = $controlrow["adminemail"]; + $org = '$gameurl'; + $mailer = 'PHP'; + + $head = ''; + $head .= "Content-Type: text/plain \r\n"; + $head .= "Date: ". date('r'). " \r\n"; + $head .= "Return-Path: $rp \r\n"; + $head .= "From: $from \r\n"; + $head .= "Sender: $from \r\n"; + $head .= "Reply-To: $from \r\n"; + $head .= "Organization: $org \r\n"; + $head .= "X-Sender: $from \r\n"; + $head .= "X-Priority: 3 \r\n"; + $head .= "X-Mailer: $mailer \r\n"; + + $body = str_replace("\r\n", "\n", $body); + $body = str_replace("\n", "\r\n", $body); + + return mail($to, $title, $body, $head); + +} + ?> \ No newline at end of file