Skip to content

Instantly share code, notes, and snippets.

@KalleZ
Created April 19, 2019 11:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KalleZ/b2fc887b7148582703050b1ebea9264c to your computer and use it in GitHub Desktop.
Save KalleZ/b2fc887b7148582703050b1ebea9264c to your computer and use it in GitHub Desktop.
entry/subscribe.php | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/entry/subscribe.php b/entry/subscribe.php
index e25f382..4fab412 100644
--- a/entry/subscribe.php
+++ b/entry/subscribe.php
@@ -31,17 +31,15 @@ if (!preg_match("!^[a-z0-9-]+$!", $_POST['maillist'])) {
die("Invalid mailing list name");
}
-// Generate needed subpart of email address
-$sub = str_replace("@", "=", $_POST['email']);
+date_default_timezone_set('UTC');
-date_default_timezone_set('Etc/UTC');
$mail = new PHPMailer;
$mail->isSMTP();
$mail->SMTPDebug = 0;
$mail->Host = 'mailout.php.net';
$mail->Port = 25;
$mail->setFrom($_POST['email']);
-$mail->addAddress("{$_POST['maillist']}-{$_POST['request']}-$sub@lists.php.net");
+$mail->addAddress("{$_POST['maillist']}-{$_POST['request']}@lists.php.net");
$mail->Subject = "PHP Mailing List Website Subscription";
$mail->Body = "This was a request generated from the form at {$_POST['referer']} by {$_POST['remoteip']}";
$mail_sent = $mail->send();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment