Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #15448, comment 69


Ignore:
Timestamp:
06/26/2025 04:31:07 PM (11 months ago)
Author:
SirLouen
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #15448, comment 69

    initial v1  
    23231. Setup the email server, in my case, my PR 8555 with `wordpress-develop` and Mailhog
    24242. Setup in WP the connection with PHPMailer to the local server
    25 3. Add the code below anywhere where it can be executed (including wp-load.php and executing such function)
     253. Add the code in supplemental artifacts, anywhere where it can be executed (including wp-load.php and executing such function)
    26264. ❌ The email is received, but no trace of two `multipart` sections as reported
    27275. 🐞 The email is not multipart by default, this is the real problem.
     
    139139
    140140But before taking a final conclusion, I need to dig a bit more into the behaviour of PHPMailer. Many users, including @dd32 and some in the post of Stack Exchange, have reported that PHPMailer is the culprit in this history.
     141
     142=== Supplemental Artifacts
     143Test code
     144{{{
     145// Set $to to an hotmail.com or outlook.com email
     146$to = "YourEmail@hotmail.com";
     147
     148$subject = 'wp_mail testing multipart';
     149
     150$message = '------=_Part_18243133_1346573420.1408991447668
     151Content-Type: text/plain; charset=UTF-8
     152
     153Hello world! This is plain text...
     154
     155
     156------=_Part_18243133_1346573420.1408991447668
     157Content-Type: text/html; charset=UTF-8
     158
     159<html>
     160<head>
     161    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     162</head>
     163<body>
     164
     165<p>Hello World! This is HTML...</p>
     166
     167</body>
     168</html>
     169
     170
     171------=_Part_18243133_1346573420.1408991447668--';
     172
     173$headers = "MIME-Version: 1.0\r\n";
     174$headers .= "From: Foo <foo@bar.com>\r\n";
     175$headers .= 'Content-Type: multipart/alternative;boundary="----=_Part_18243133_1346573420.1408991447668"';
     176
     177
     178// send email
     179wp_mail( $to, $subject, $message, $headers );
     180}}}