How to Send Emails in WordPress from the Functions.php

I have been working on a project that needs to occasionally send off emails. If you need to do so, here’s how with wp_mail():

add_filter(‘wp_mail_content_type’,create_function(”, ‘return “text/html”; ‘));
wp_mail(‘whoever@whatever.com’, ‘Subject’, ‘Message’);

Thanks to WordPress Cheat Sheets for the code!

3 thoughts on “How to Send Emails in WordPress from the Functions.php

  1. Thanks so much for this information Zack, I was trying to figure out how to change the email subject in a theme I’ve downloaded.

    I also want to tell you that I’m a Treehouse member and really like your lessons and your teaching style.

    Thanks for everything, I just discovered your blog and I’m going to be coming back.

    Cheers from Argentina.

    Like

Leave a comment