Title: wp_mail() not working
Last modified: August 19, 2016

---

# wp_mail() not working

 *  [windskystar](https://wordpress.org/support/users/windskystar/)
 * (@windskystar)
 * [15 years, 11 months ago](https://wordpress.org/support/topic/wp_mail-not-working/)
 * 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](https://wordpress.org/support/users/macmanx/)
 * (@macmanx)
 * [15 years, 11 months ago](https://wordpress.org/support/topic/wp_mail-not-working/#post-1591772)
 * Have you tried this plugin?
 * [http://wordpress.org/extend/plugins/wp-mail-smtp/](http://wordpress.org/extend/plugins/wp-mail-smtp/)
 *  Thread Starter [windskystar](https://wordpress.org/support/users/windskystar/)
 * (@windskystar)
 * [15 years, 11 months ago](https://wordpress.org/support/topic/wp_mail-not-working/#post-1591937)
 * I tried, but it doesn’t work. but mail() works. is there any difference?
 *  Moderator [James Huff](https://wordpress.org/support/users/macmanx/)
 * (@macmanx)
 * [15 years, 11 months ago](https://wordpress.org/support/topic/wp_mail-not-working/#post-1591955)
 * 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](https://wordpress.org/support/users/windskystar/)
 * (@windskystar)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/wp_mail-not-working/#post-1591983)
 * But it works when I used mail(). So I doubt that it’s a spam filter.
 *  [gillespieza](https://wordpress.org/support/users/gillespieza/)
 * (@gillespieza)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/wp_mail-not-working/#post-1592108)
 * 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 <myname@mydomain.com>' . "\r\n\\";
       wp_mail('myname@mydomain.com', '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 “wordpress@mydomain.com” fixed the 
   problem.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘wp_mail() not working’ is closed to new replies.

## Tags

 * [wp_mail](https://wordpress.org/support/topic-tag/wp_mail/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 5 replies
 * 3 participants
 * Last reply from: [gillespieza](https://wordpress.org/support/users/gillespieza/)
 * Last activity: [15 years, 7 months ago](https://wordpress.org/support/topic/wp_mail-not-working/#post-1592108)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
