WordPress.org

Ready to get started?Download WordPress

Forums

WP_Mail sends one email only (3 posts)

  1. mearls
    Member
    Posted 3 years ago #

    I'm currently having a problem in which wp_mail sends only one email where two are asked for.

    It happens anywhere the wp_mail method is used. It's especially detrimental in that it doesn't send admin emails when a new user is created (but it does send a new email to the user informing them of their new password).

    In addition, I'm getting an error from the retrieve password portion of logon.php: "The e-mail could not be sent."

    I know that wp_mail is working, as it sends the mail to the user. More detail: when I started debugging the code, I noticed that it only sends the second email if two emails are coded.

    Example:

    wp_mail($email, "test 1", "test 1");
    wp_mail($email, "test 2", "test 2");

    In this case, I only get the email "test 2".

    I have the mail set to use SMTP and the server is a Windows box running IIS 7 with PHP installed.

    I've spent two days on this already and I'm stumped. I've searched the web and these forums for an answer but did not find anything that pertains to this specific problem.

  2. mjaning
    Member
    Posted 2 years ago #

    I am having a similar problem. I wrote a plugin to override the wp_notify_moderator for sending the same email to different accounts, but the moderation notification is send only for the website administrator email it does not matter what accounts.

    The var email_to below is an array with 3 emails correctly set.

    foreach ( $email_to as $email )
    @wp_mail($email, $subject, $notify_message, $message_headers);

    Does anyone know why the emails different than the website administrator do not fire off the email send?

    I appreciate any help and/or master guide lines saying where to look for.

  3. mjaning
    Member
    Posted 2 years ago #

    Please ignore the post above, I ended up discovering an internal routing problem who was responsible for not delivering the email for some accounts.

    After the problem was fixed all 3 accounts I have set received the notify moderation email.

Topic Closed

This topic has been closed to new replies.

About this Topic