Skip to content

Commit 9a43e3e

Browse files
committed
Message id support
1 parent 7715533 commit 9a43e3e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

system/mail/smtp.php

+2
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ public function send() {
7171
}
7272

7373
$serverName = ($_SERVER['HTTP_HOST'] ?? $_SERVER['SERVER_NAME'] ?? getenv('SERVER_NAME'));
74+
$messageId = base_convert(str_replace(['.', ' '], '', microtime()), 10, 36) . '.' . base_convert(bin2hex(openssl_random_pseudo_bytes(8)), 16, 36) . substr($this->option['from'], strrpos($this->option['from'], '@'));
7475

7576
$boundary = '----=_NextPart_' . md5(time());
7677

@@ -86,6 +87,7 @@ public function send() {
8687
$header .= 'Reply-To: =?UTF-8?B?' . base64_encode($this->option['reply_to']) . '?= <' . $this->option['reply_to'] . '>' . EOL;
8788
}
8889

90+
$header .= 'Message-ID: <' . $messageId . '>' . PHP_EOL;
8991
$header .= 'Return-Path: ' . $this->option['from'] . EOL;
9092
$header .= 'X-Mailer: PHP/' . phpversion() . EOL;
9193
$header .= 'Content-Type: multipart/mixed; boundary="' . $boundary . '"' . EOL . EOL;

0 commit comments

Comments
 (0)