From 8905de70ba2588202b45de9cec210dc53bf8bb09 Mon Sep 17 00:00:00 2001 From: Helen Chong <119173961+helenclx@users.noreply.github.com> Date: Wed, 26 Jun 2024 18:32:28 +0800 Subject: [PATCH] Replace PHP mail() functions with PHPMailer script --- admin.php | 130 ++++++++++-------- contact.php | 46 ++++--- .../{config.example.php => config.php} | 0 join.php | 97 +++++++------ update.php | 63 +++++---- 5 files changed, 193 insertions(+), 143 deletions(-) rename contactform/{config.example.php => config.php} (100%) diff --git a/admin.php b/admin.php index e499345..3679211 100644 --- a/admin.php +++ b/admin.php @@ -1,5 +1,21 @@ setLanguage(CONTACTFORM_LANGUAGE); +$mail->SMTPDebug = CONTACTFORM_PHPMAILER_DEBUG_LEVEL; +$mail->isSMTP(); +$mail->Host = CONTACTFORM_SMTP_HOSTNAME; +$mail->SMTPAuth = true; +$mail->Username = CONTACTFORM_SMTP_USERNAME; +$mail->Password = CONTACTFORM_SMTP_PASSWORD; +$mail->SMTPSecure = CONTACTFORM_SMTP_ENCRYPTION; +$mail->Port = CONTACTFORM_SMTP_PORT; +$mail->CharSet = CONTACTFORM_MAIL_CHARSET; +$mail->Encoding = CONTACTFORM_MAIL_ENCODING; + if (isset($_COOKIE['bellabuffs'])) { if ($_COOKIE['bellabuffs'] == md5($admin_name.$admin_pass.$secret)) { if (isset($_GET['ap'])) { $page = $_GET['ap']; } else { $page = ""; } @@ -17,9 +33,9 @@ if (isset($_COOKIE['bellabuffs'])) { $pageurl = "admin.php?ap=manage_members"; $fileurl = "members.txt"; } - + echo "
Warning: Do not try to edit multiple members at once, do not try to approve and delete the same member.
"; - + $count = count($file); if ($count == 0) { echo 'No '.$wording.' members at this time.
'; exit(include('footer.php')); } @@ -37,12 +53,12 @@ if (isset($_COOKIE['bellabuffs'])) { echo " "; } echo " \n\n "; - + if (isset($_GET['page']) && is_numeric($_GET['page'])) $i = $perpage * ($_GET['page'] - 1); else $i = 0; - + $end = $i + $perpage; - + if ($end > $count) $end=$count; ?>