|
Posting to your WordPress blog via e-mailI wondered why I´m getting asked so often how one can setup the "posting by email" option in WordPress and also how to use an autoresponder to automatically post a series of articles to a WordPress blog. When I read the article on the WordPress codex about this topic, I realized that it might indeed be a little bit confusing for many people, so I decided a more detailed step-by-step guide would be necessary. Well - here it is. First of all, the steps you need to take in the right order:
Next, let´s go into the details of each single step: 1. Creating a new mail accountFirst, you need to create a new mail account with POP access on your domain. It is very important that you create a completely new mail account (mailbox) and not just another e-mail alias (address). And it´s also vitally important that you create this account with an e-mail address that is impossible to guess and that you don´t reveal this e-mail address to anyone. Why ? Because all e-mail that you will receive to this account will be posted to your blog. So, you definitely don´t want that spammers find out this special e-mail address. How you setup an e-mail account depends on your webhosting control panel. I have included step by step instructions below for cPanel, which is a very popular and widely used control panel. If you would like to see flash tutorials for other things on cPanel, too, visit Hostgator´s tutorial section. I recommend that you use a random string of letters and numbers with at least 8 digits for this new e-mail account´s user name, starting with a letter, for example: x4js29bp. Here are the step-by-step instructions for cPanel users: 1. Login to your control panel and click on the Mail icon. 2. In the mail manager main menu, click on Manage/Add/Remove Accounts and on the following page, click on the link Add Account. 3. Fill in a username and a password for your new mail account and hit the Create button. 4. Note down the login and the password - you will need it in the next step. 2. Configure the WP optionsLogin to your blog´s admin panel and go to » Options » Writing. Scroll down to the section Writing by e-mail. Here you need to enter all the access information for your secret mail box, just like you would do when adding a new e-mail account to your e-mail client. Don´t forget to hit the Update Options button.
Congratulations - you´re ready for posting by e-mail. 3. Testing the systemNow, before you jump ahead and e-mail to your blog like crazy or setup an automatic posting-by-email system, I highly recommend you test your setup first. Simply open your e-mail client (Outlook Express, Eudora, Thunderbird, ...), compose and send a new e-mail to your secret e-mail address. The subject line of your e-mail will be used as title for the blog post and everything inside the e-mail´s body will be used in the body of your post. After sending the e-mail, wait a minute and then open your favorite web browser and run the script wp-mail.php by typing it´s URL into the address window of your browser. Assuming that you have installed your WordPress blog in a subdirectory called "blog" on your domain, the URL would be like: http://www.yourdomain.com/blog/wp-mail.php What now happens is that WordPress connects to your secret e-mail box and checks it for new messages. Then it converts all the new e-mails into blog posts and after posting them to your blog it deletes the messages from the mailbox. You will see the progress of this process in your browser. Once WordPress has completed the process, visit your blog and see if your e-mail has been successfully posted to your blog. If everything´s fine, you may continue with step 4, but before - read these ... ... important tips for composing your e-mail messagesSome things you need to know if you want to make sure that you get the content of your e-mails posted like you want it to appear on your blog. 1. The subject of your e-mails will be used as title for the post. 2. Line breaks inside your e-mail message (i.e. everywhere you hit the "Enter" key) will be transformed into new lines in your blog post, too. Hence, you shouldn´t use line breaks inside paragraphs. 3. Special characters need to be escaped with HTML character entities. For those of you who are not familiar with HMTL yet, this means that you need to replace characters like apostrophes, quotes, ampersands, etc... with HTML code. And btw - you should learn HTML today. Examples for HTML character entities (HTML code --> renders): 4. To display hyperlinks, you need to write them as HTML code in your e-mails. For example: to get
a link like this - EasyWebTutorials - you would type in your e-mail: 4. Setting up a cron jobI´m sure you want to automate as much as possible and manually calling the script wp-mail.php everytime after you send an e-mail is not what you want to do. The easiest way to automate this part is to setup a cron job on your server to periodically view wp-mail.php. Of course, this only works if your webhost allows you to use cron jobs - every good webhost does. Again, I´m showing you screenshots from cPanel - if your webhost has a different control panel, ask them how to setup a cron job. And btw - I´d be glad if you could provide me with some screenshots that I can publish here. It won´t be necessary to check for new e-mails more than once per hour, maybe even only 4 times per day. Don´t waste your server resources by un-necessarily running scripts. Here is how to setup the cronjob for wp-mail.php: 1. In cPanel, click on the Cron jobs link or icon and on the next page choose the
advanced (Unix Style) experience level. You will then see these fields: 2. In the command field, you need to enter your server´s path to
PHP and the server path to wp-mail.php, so the entire text
string you enter in this field should look something like this: Of course, it depends on your webhost what exactly your server path is, so if you don´t know it yet, you should ask them or check their user manuals / knowledge base. 3. In the Minute field, enter any number between 0 and 60 and in the Hour field, enter an asterix if you want to run the cronjob once every hour. Or if you want to run the cronjob only two times per day (should be enough if you are not posting a lot by e-mail), simply enter two hours in the Hour field, separated by a comma. Examples: To run it only once per day, at 2:30 a.m.: To run it 2 times per day, at 11:30 a.m. and 11:30 p.m.: 4. Press the Commit Changes button. Alternative Option to Cronjobs: If you experience troubles in setting up a cronjob, you can also use the WP-Cron plugin by Skippy. Please read the instructions for using this plugin on the author´s website. 5. Creating an autoresponder follow-up sequenceIf you want to post a series of articles over a certain period of time on auto-pilot in order to create an automatic constant growth of your website to please the search engines, one way would be to setup a follow-up autoresponder and enter all your articles as a follow-up sequence. Then you would subscribe yourself to this autoresponder using your secret e-mail address. Limitations and Solutions:There are quite a few problems and limitations with the basic setup of the "writing by e-mail system" - the way we have set it up until now. You might have already noticed that you are only able to send title and body of your blog post by e-mail and that all messages are posted to the default category. You can´t enter custom fields like meta keywords and description for each blog post, you can´t include images, you can´t write a post slug and other things you could do if you were writing the post directly in your blog´s admin panel. When you are sending e-mails to your secret mail account from a free e-mail provider who includes ads in the footer of each outgoing e-mail, you would get these ads included on your blog, too. When you setup a follow-up autoresponder to post a series of messages, then you would also get the unsubscribe links posted to your blog at the bottom of each message and if you are using the free, ad-supported version of GetResponse, you would also get the advertisements posted to your blog. Fortunately, there is the "Postie" plugin that expands the options for posting by e-mail and gives you more flexibility and control over the content that is posted from your e-mail message to your blog. More about it in the next lesson. |
||
Main Navigation |
|
|
Home :::
Contact :::
Advertise :::
Submit Tutorials :::
Links :::
Sitemap
|