From 12f8de5da82e076959bc7bca53e47c8ece0bfa73 Mon Sep 17 00:00:00 2001 From: dignajar Date: Sat, 7 May 2016 00:22:48 -0300 Subject: [PATCH] updates --- bl-kernel/admin/controllers/login-email.php | 1 + bl-kernel/boot/init.php | 3 --- bl-kernel/helpers/email.class.php | 19 +++++++++++++------ 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/bl-kernel/admin/controllers/login-email.php b/bl-kernel/admin/controllers/login-email.php index b5bbef42..fdfbfb3e 100644 --- a/bl-kernel/admin/controllers/login-email.php +++ b/bl-kernel/admin/controllers/login-email.php @@ -45,6 +45,7 @@ function checkPost($args) $sent = Email::send(array( 'from'=>$Site->emailFrom(), + 'fromName'=>$Site->title(), 'to'=>$email, 'subject'=>$subject, 'message'=>$message diff --git a/bl-kernel/boot/init.php b/bl-kernel/boot/init.php index e6987193..eb844322 100644 --- a/bl-kernel/boot/init.php +++ b/bl-kernel/boot/init.php @@ -82,9 +82,6 @@ define('NO_PARENT_CHAR', '3849abb4cb7abd24c2d8dac17b216f17'); // Post per page on Manage->Posts define('POSTS_PER_PAGE_ADMIN', 10); -// Check if JSON encode and decode are enabled. -// define('JSON', function_exists('json_encode')); - // Cli mode status for new posts/pages define('CLI_MODE', true); diff --git a/bl-kernel/helpers/email.class.php b/bl-kernel/helpers/email.class.php index c2ba4066..5d1d5f61 100644 --- a/bl-kernel/helpers/email.class.php +++ b/bl-kernel/helpers/email.class.php @@ -5,31 +5,38 @@ class Email { // Returns TRUE if the mail was successfully accepted for delivery, FALSE otherwise. public static function send($args) { + // Current time in unixtimestamp $now = time(); + // Domain + $domainParse = parse_url(DOMAIN); + $headers = array(); $headers[] = 'MIME-Version: 1.0'; $headers[] = 'Content-type: text/html; charset=utf-8'; + $headers[] = 'Content-Transfer-Encoding: 8bit'; - $headers[] = 'From: '.$args['from']; + $headers[] = 'From: =?UTF-8?B?'.base64_encode($args['fromName']).'?= <'.$args['from'].'>'; $headers[] = 'Reply-To: '.$args['from']; $headers[] = 'Return-Path: '.$args['from']; - $headers[] = 'message-id: <'.$now.'webmaster@'.DOMAIN.'>'; + $headers[] = 'message-id: <'.$now.'webmaster@'.$domainParse['host'].'>'; $headers[] = 'X-Mailer: PHP/'.phpversion(); + $subject = '=?UTF-8?B?'.base64_encode($args['subject']).'?='; + $message = ' + BLUDIT - -
-
BLUDIT
+ +
'.$args['message'].'
'; - return mail($args['to'], $args['subject'], $message, implode(PHP_EOL, $headers)); + return mail($args['to'], $subject, $message, implode(PHP_EOL, $headers)); } } \ No newline at end of file