• Resolved juankvillegas

    (@juankvillegas)


    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 protected]";
    $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

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Gregor Capuder

    (@capuderg)

    Hi @juankvillegas,

    which mailer do you use?

    I tested this with your exact code with the “Other SMTP” mailer and all of the emails were sent just OK (I received all of them in my mailbox and no error is displayed in the plugin settings).

    This is strange behavior… Do you have any other email-sending plugins installed? Maybe some other plugin is clearing the email message body?

    Take care!

    Thread Starter juankvillegas

    (@juankvillegas)

    Thank you for your quick answer @capuderg

    I checked the other plugins and the issue was caused by an outdated “Email Templates” plugin. Once I updated it to the last version, I started receiving all the messages.

    Plugin Author Gregor Capuder

    (@capuderg)

    Hi @juankvillegas,

    that’s great! ??

    Thanks for letting us know.

    Have a nice day!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘WordPress is not sending the 2nd email in the same request’ is closed to new replies.