Skip to content

Commit a8a3f5e

Browse files
authored
Merge pull request #2 from eminsr/next
feat: add connection charSet
2 parents 4b10674 + cad8e8f commit a8a3f5e

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ use PHPMailer\PHPMailer\PHPMailer;
4949
Mailer::connect([
5050
'host' => 'smtp.mailtrap.io',
5151
'port' => 2525,
52+
'charSet' => PHPMailer::CHARSET_UTF8,
5253
'security' => PHPMailer::ENCRYPTION_STARTTLS,
5354
'auth' => [
5455
'username' => 'MAILTRAP_USERNAME',

src/Mail/Mailer.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ public static function connect($connection)
4646
static::$mailer->Host = $connection['host'];
4747
static::$mailer->Port = $connection['port'];
4848

49+
if (isset($connection['charSet'])) {
50+
static::$mailer->CharSet = $connection['charSet'];
51+
}
52+
4953
if (isset($connection['keepAlive']) || isset(static::$config['keepAlive'])) {
5054
static::$mailer->SMTPKeepAlive = $connection['keepAlive'] ?? static::$config['keepAlive'];
5155
}

0 commit comments

Comments
 (0)