Divi WordPress Theme
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

WordPress fix Reply To: Testing the wp_mail Function – how to do that?

Discussion in 'Misc WordPress Requests' started by say_hello, Nov 4, 2017.

  1. say_hello


    Reply To: Testing the wp_mail Function – how to do that?, by say_hello

    after looking at different options and methods i finally came towards tests in a local area.

    i want to share all the trials and tests and the subsequent findings with the community. So they do not have to reinvent the wheel.

    the new tests:
    I’m trying to test wp_mail() in my local xampp. Well – see the first results are the following; When I var dump wp_mail,I get Boolean false.This is my code

    $to = "[email protected]";
    $subject = 'my subject';
    $message = 'I would like to work with you';
    $headers = '';

    $sent_message = wp_mail( $to, $subject, $message, $headers);
    var_dump($sent_message); // i get boolean false here.
    if ( $sent_message ) {
    echo 'The test message was sent. Check your email inbox.';
    } else {
    echo 'The message was not sent!'; //this gets printed in d end.

    some ideas regarding the above code:

    well – since wp_mail() falls back to php’s mail() function which requires a configured Message Transfer Agent ( MTA) on the host. I have the results.
    Well – i possibly could go and get results while install and configure such a MTA.
    BTW; i am running a Linux like OS, so in this case the SSMTP solution might be a an easy solution on which i can use any mail-provider to send the system mails via SMTP.
    Regarding the SMTP options: Another MTA would be Sendmail, a fully featured, yet difficult to configure MTA.
    Or we simply could use a plugin like WP Mail SMTP which implements a direct SMTP connection in PHP and bypass the mail() usage.

    new tests are coming soon. … i hope to fix the issues with wp_mail soon

    Reply To: Testing the wp_mail Function – how to do that?

Share This Page

Monarch Social Sharing Plugin