File tree 2 files changed +12
-1
lines changed
2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -133,6 +133,14 @@ protected function getCrlf() : string
133
133
return "\r\n" ;
134
134
}
135
135
136
+ protected function getCharset () : string
137
+ {
138
+ if (isset ($ this ->mailer )) {
139
+ return $ this ->mailer ->getCharset ();
140
+ }
141
+ return 'utf-8 ' ;
142
+ }
143
+
136
144
public function setBoundary (string $ boundary = null ) : static
137
145
{
138
146
$ this ->boundary = $ boundary ?? \bin2hex (\random_bytes (16 ));
@@ -271,7 +279,7 @@ protected function renderMessage(
271
279
$ crlf = $ this ->getCrlf ();
272
280
$ part = '--alt- ' . $ this ->getBoundary () . $ crlf ;
273
281
$ part .= 'Content-Type: ' . $ contentType . '; charset= '
274
- . $ this ->mailer -> getCharset () . $ crlf ;
282
+ . $ this ->getCharset () . $ crlf ;
275
283
$ part .= 'Content-Transfer-Encoding: base64 ' . $ crlf . $ crlf ;
276
284
$ part .= \chunk_split ($ message ) . $ crlf ;
277
285
return $ part ;
Original file line number Diff line number Diff line change @@ -279,5 +279,8 @@ public function testToString() : void
279
279
$ message = (string ) new Message ();
280
280
self ::assertStringContainsString ('MIME-Version ' , $ message );
281
281
self ::assertStringContainsString ('Date ' , $ message );
282
+ $ message = new Message ();
283
+ $ message ->setPlainMessage ('Hello! ' );
284
+ self ::assertStringContainsString ('charset=utf-8 ' , (string ) $ message );
282
285
}
283
286
}
You can’t perform that action at this time.
0 commit comments