@@ -1272,6 +1272,8 @@ protected function buildMessage()
12721272 return ;
12731273
12741274 case 'html ' :
1275+ $ boundary = uniqid ('B_ALT_ ' , true );
1276+
12751277 if ($ this ->sendMultipart === false )
12761278 {
12771279 $ hdr .= 'Content-Type: text/html; charset= '
@@ -1280,8 +1282,6 @@ protected function buildMessage()
12801282 }
12811283 else
12821284 {
1283- $ boundary = uniqid ('B_ALT_ ' , true );
1284-
12851285 $ hdr .= 'Content-Type: multipart/alternative; boundary=" ' . $ boundary . '" ' ;
12861286 $ body .= $ this ->getMimeMessage () . $ this ->newline . $ this ->newline
12871287 . '-- ' . $ boundary . $ this ->newline
@@ -1306,7 +1306,7 @@ protected function buildMessage()
13061306
13071307 if ($ this ->sendMultipart !== false )
13081308 {
1309- $ this ->finalBody .= '-- ' . $ boundary . '-- ' ; // @phpstan-ignore-line
1309+ $ this ->finalBody .= '-- ' . $ boundary . '-- ' ;
13101310 }
13111311
13121312 return ;
@@ -2184,13 +2184,16 @@ protected function sendCommand($cmd, $data = '')
21842184 $ this ->sendData ('QUIT ' );
21852185 $ resp = 221 ;
21862186 break ;
2187+
2188+ default :
2189+ $ resp = null ;
21872190 }
21882191
21892192 $ reply = $ this ->getSMTPData ();
21902193
21912194 $ this ->debugMessage [] = '<pre> ' . $ cmd . ': ' . $ reply . '</pre> ' ;
21922195
2193- if (( int ) static ::substr ($ reply , 0 , 3 ) !== $ resp ) // @phpstan-ignore-line
2196+ if ($ resp === null || (( int ) static ::substr ($ reply , 0 , 3 ) !== $ resp ))
21942197 {
21952198 $ this ->setErrorMessage (lang ('Email.SMTPError ' , [$ reply ]));
21962199
@@ -2278,6 +2281,8 @@ protected function sendData($data)
22782281 {
22792282 $ data .= $ this ->newline ;
22802283
2284+ $ result = null ;
2285+
22812286 for ($ written = $ timestamp = 0 , $ length = static ::strlen ($ data ); $ written < $ length ; $ written += $ result )
22822287 {
22832288 if (($ result = fwrite ($ this ->SMTPConnect , static ::substr ($ data , $ written ))) === false )
@@ -2307,7 +2312,7 @@ protected function sendData($data)
23072312 $ timestamp = 0 ;
23082313 }
23092314
2310- if ($ result === false ) // @phpstan-ignore-line
2315+ if (! is_int ( $ result))
23112316 {
23122317 $ this ->setErrorMessage (lang ('Email.SMTPDataFailure ' , [$ data ]));
23132318
0 commit comments