Knowledgebase
How to add posts via email in WordPress
In WordPress it's possible to add and publish posts via email. What this means is that you can have an email account whose messages are downloaded by WordPress and published as posts. We'd rather recommend you use the regular way of publishing posts from the admin panel, but if nevertheless you have to use this option, it's possible.
To be able to publish posts through email you have to do a few things:
- You need to have a separate email account that you don't use for anything else. All emails in the inbox of that account will be published as posts. It's advisable to use an email account that you've created from your hosting account, and not a web-based email account (e.g. Gmail, Hotmail, Yahoo).
- You need to configure the email settings in the admin panel of your WordPress. After you log in go to Settings menu>Writing sub-menu; the options are in the section Post via e-mail.
The first option in that section is Mail Server. In that field type the URL address of the server on which your account is hosted (e.g. e.hostknox.com). If you want to use an encrypted connection (SSL/TLS), put ssl:// in front of the URL address (e.g. ssl://e.hostknox.com). The default port number in the Port field is 110. Leave it like this for a non-encrypted connection. If you connect using SSL/TLS, change the number to 995. In the field for Login Name type the full email address (e.g. username@yourdomain.com), and in the field for Password type the password of the email account. You can use the drop-down menu Default Mail Category to change the default category to which new posts published via email are automatically assigned.
- The last thing that you have to do is to set WordPress to actually download the email messages from the mailbox and publish them as posts. This is done by executing the file wp-mail.php that's in the root WordPress directory on your WordPress hosting account.
You can do this manually by opening with your web-browser the URL address of the wp-mail.php file. If your WordPress is installed directly in the public_html folder on your hosting account that will be yourdomain.com/wp-mail.php. If you want this to be done automatically, you can set up a cron job that executes the wp-mail.php file. Another way is to insert some code in the footer.php file of your theme.
For more information, including on the various ways of executing wp-mail.php, check out the tutorial on how to publish posts in WordPress via email.