Replies: 0
When I try to send more than one email message in the same request, only de 1st message is sent, the rest of the messages are blocked with the error “Message body empty”.
The following code should send 4 different emails, each one with different subject and message, but only the first one is sent:
$to = "email@example.com";
$subject = "Mail test ";
$message = "This is the body ";
wp_mail($to, $subject . "1", $message . "1"); // Sent
wp_mail($to, $subject . "2", $message . "2"); // Not sent (Message body empty)
wp_mail($to, $subject . "3", $message . "3"); // Not sent (Message body empty)
wp_mail($to, $subject . "4", $message . "4"); // Not sent (Message body empty)
I’m using WordPress 5.6.2 and WP Mail SMTP 2.6.0