Tag Archives: Code

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!


Thanks to core contributor, Tom McFarlin, for writing up this great series of posts on WP Tuts+ dissecting the recommended coding standards for WordPress theme and plugin development.