• I am trying to add a new user, but it is not sending an email to people whose emails are hotmail.com or gmail.com. I noticed that it is calling wp_email().

    I installed SMTP and had a correct smtp host, username and pswd, but it’s not working.

    Is there any configuration that I need to make or a plugin that I need to install?

    Thanks. Please help.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Moderator James Huff

    (@macmanx)

    Thread Starter windskystar

    (@windskystar)

    I tried, but it doesn’t work. but mail() works. is there any difference?

    Moderator James Huff

    (@macmanx)

    Then everything should be working properly. Contact your hosting provider. It’s possible that your server has been blacklisted by Gmail and Hotmail’s spam filters, which is unfortunately a common occurrence with most shared hosting providers.

    Thread Starter windskystar

    (@windskystar)

    But it works when I used mail(). So I doubt that it’s a spam filter.

    Have you checked that wp_mail() is working if you provide all the arguments is needs?

    Try creating a simple template file in your theme folder, like so:

    <?php
    /* Template Name: Test */
    get_header();
    // $headers = 'From: My Name <[email protected]>' . "\r\n\\";
    wp_mail('[email protected]', 'The subject', 'The message',  $headers); 
    
    get_footer(); ?>

    Then create a test page using “Test” as the template. Preview the page (you shouldn’t see anything on the page, actually) and then check your email. If you still get nothing, uncomment the line with $headers (just delete the two // at the start of the line). Save the template, reload the test page, and check your mail again. If it now works, the problem is that there is no “from” address being set when wp_mail is being called elsewhere.

    On my host, simply creating an email user “[email protected]” fixed the problem.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘wp_mail() not working’ is closed to new replies.