Wordpress Post via email (wp-mail.php)

1 minute read

For the last few years I have used a plugin called postie that would let me email automated posts to my blog and they would automatically get posted for me. It worked great for years until a few months ago (it took me a while to even notice)

I found that the original author had abandoned this project years ago and a another took up the project for a few years and has since abandoned it as well. Not wanting to hunt and peck though his code I searched for an alternative.

I found wp-mail.php a build in to wordpress function to do the same thing.  It was missing some of the features that I needed but was almost there.

Notes on setup of wp-mail.php 

  • You must post in plain text. RTF or HTML will not work and the body of your email will be stripped from the post. use PLAIN TEXT
  • You can force wordpress to check the email box by hitting this url http://example.com/installdir/wp-mail.php
  • By default if you send an email from an email account that already has a wordpress account linked to that email. Wordpress will automatically PUBLISH that post.  But if you send an email from an account that does not have publishing access (author) then it will be added with the status of "pending"
  • I kept getting this error message when hitting the wp-mail.php check email url. "Slow down cowboy, no need to check for new mails so often!" This is caused because there is a check in the wp-mail.php file that make sure that you don't call this function more then once every 5 mins. This is hard coded in to the source code. You can remove this limitation by commenting out line 28-29 in Wp-Admin.php.
    // if ( $last_checked )
    // wp_die(__('Slow down cowboy, no need to check for new mails so often!'));

Leave a comment