Monday, October 27, 2008

Email Posting with WordPress


WordPress supports email posting, albeit with two main drawbacks. First, it does not support email attachments. And second, it does not filter the sender's email address. Anyone can send email to the email address and have their messages appear on your blog. Without sender-address filtering, your moblog can be easily flooded with spam messages.

A patch by "lansmash" fixed both drawbacks. Applying the patch is straightforward. First, download the file wp-mail-0.2.zip from the web address http://blade.lansmash.com/index.php?cat=5. Unzip the archive to the WordPress root directory. This adds the files PEAR.php and mimedecode.php to the directory and replaces the original wp-mail.php file. Now, create two directories, wp-photos and wp-filez, under the WordPress root directory to store images and other attachments, respectively. You can choose other directory names as long as you remember to modify the corresponding settings in the new wp-mail.php file.

If you want automatic picture resizing (an important feature for megapixel camera phones), you need to install an additional hack provided by "Hugo." Simply replace the default wp-mail.php file in your WordPress installation with a new file downloaded from http://www.vienna360.net/files/wp-mail.phps.

Now, you can test your setup by sending an email message with a picture attachment to the email address specified in the Options Writing section of the WordPress configuration page. Make sure you enter the correct server and login information. Nothing appears on your blog just yet. That is because the wp-mail.php script needs to be manually loaded to poll the email server for the new message. Do this by pointing your browser to http://your-domain-name/MyMoblog/wp-mail.php.

Of course, if you need to open a browser and load the wp-mail.php script manually every time you post a moblog entry, it defeats the whole point of moblogging. So, let's discuss how to automate the email polling process in WordPress.

No comments: