{"id":5810,"date":"2026-02-12T20:45:28","date_gmt":"2026-02-13T01:45:28","guid":{"rendered":"https:\/\/chubes.net\/?documentation=wp-mail-php"},"modified":"2026-03-13T03:29:21","modified_gmt":"2026-03-13T07:29:21","slug":"wp-mail-php","status":"publish","type":"documentation","link":"https:\/\/chubes.net\/docs\/wordpress-core\/root-files\/wp-mail-php\/","title":{"rendered":"wp-mail.php"},"content":{"rendered":"<h2 class=\"wp-block-heading\">Purpose<\/h2><p>Implements Post by Email: pulls messages from a configured POP3 mailbox and turns them into posts.<\/p><h2 class=\"wp-block-heading\">Flow<\/h2><ul class=\"wp-block-list\"><li>Loads WordPress and checks <code>enable_post_by_email_configuration<\/code> filter.<\/li><li>Validates mailserver settings and rate-limits execution.<\/li><li>Connects to the POP3 mailbox and iterates messages.<\/li><li>Parses headers\/body, maps sender to a user, builds post data.<\/li><li>Inserts post via <code>wp_insert_post()<\/code> and deletes the processed email.<\/li><\/ul><h2 class=\"wp-block-heading\">Key functions called<\/h2><ul class=\"wp-block-list\"><li><code>get_option()<\/code> \/ <code>set_transient()<\/code> \/ <code>get_transient()<\/code><\/li><li><code>wp_set_current_user( 0 )<\/code><\/li><li><code>wp_insert_post()<\/code><\/li><li><code>xmlrpc_getposttitle()<\/code><\/li><\/ul><h2 class=\"wp-block-heading\">Hooks fired<\/h2><ul class=\"wp-block-list\"><li>Actions:<ul class=\"wp-block-list\"><li><code>wp-mail.php<\/code> (custom action name)<\/li><li><code>publish_phone<\/code><\/li><\/ul><\/li><li>Filters:<ul class=\"wp-block-list\"><li><code>enable_post_by_email_configuration<\/code><\/li><li><code>wp_mail_original_content<\/code><\/li><li><code>phone_content<\/code><\/li><\/ul><\/li><\/ul>","protected":false},"excerpt":{"rendered":"<p>Purpose Implements Post by Email: pulls messages from a configured POP3 mailbox and turns them into posts. Flow Loads WordPress and checks enable_post_by_email_configuration filter. Validates mailserver settings and rate-limits execution&#8230;.<\/p>\n","protected":false},"featured_media":0,"template":"","meta":{"footnotes":""},"tags":[],"project":[657],"project_type":[749],"class_list":["post-5810","documentation","type-documentation","status-publish","hentry","project-root-files","project_type-wordpress-reference"],"project_info":{"id":589,"name":"WordPress Core","slug":"wordpress-core"},"project_type_info":{"id":749,"name":"WordPress Reference","slug":"wordpress-reference"},"_links":{"self":[{"href":"https:\/\/chubes.net\/wp-json\/wp\/v2\/documentation\/5810","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/chubes.net\/wp-json\/wp\/v2\/documentation"}],"about":[{"href":"https:\/\/chubes.net\/wp-json\/wp\/v2\/types\/documentation"}],"version-history":[{"count":3,"href":"https:\/\/chubes.net\/wp-json\/wp\/v2\/documentation\/5810\/revisions"}],"predecessor-version":[{"id":10986,"href":"https:\/\/chubes.net\/wp-json\/wp\/v2\/documentation\/5810\/revisions\/10986"}],"wp:attachment":[{"href":"https:\/\/chubes.net\/wp-json\/wp\/v2\/media?parent=5810"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/chubes.net\/wp-json\/wp\/v2\/tags?post=5810"},{"taxonomy":"project","embeddable":true,"href":"https:\/\/chubes.net\/wp-json\/wp\/v2\/project?post=5810"},{"taxonomy":"project_type","embeddable":true,"href":"https:\/\/chubes.net\/wp-json\/wp\/v2\/project_type?post=5810"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}