Ever since I setup a system on my personal blog that allows me to post photos from my phone straight to WordPress, people have been asking me: how exactly do you do that?!?
Itâ€™s quite simply really and only requires a new email address and a WordPress plugin called Postie.
How it works
My new phone supports IMODE emailing, which is a service specific to my provider. IMODE allows me to subscribe to content such as movie session times, news, weather etc. Your provider may not have IMODE; however other providers (Vodafone live for example) may offer similar connectivity.
To sum it up;
1) You take your photo.
2) Attach it to an email on your phone and send it to a secret address that YOU set up.
3) The WordPress plugin Postie can check this secret email account and decode the information inside.
4) It then creates a WordPress post, containing the emails subject, body and any attachments.
So how can I set this up?
1) Simply unzip postie into your wp-content/plugins folder.
2) Activate postie from the WordPress admin plugins page
Now we need to create a secret email address. When I say secret, I mean an address that you tell nobody. Postie will check all incoming email addresses and only accept emails that have YOUR from address. However, it is possible for people to forge this address â€“ and then youâ€™d have randoms posting straight to your blog which could be nasty.
Once you have created this new email account;
1) Visit the WordPress admin panel, select the options menu and then select Configure Postie.
2) Here you can change various Postie settings. One thing youâ€™ll want to change is the default posting category.
3) At the bottom, fill out the email details such as incoming mail server (POP3 or IMAP) and your new email address username and password.
4) Create two new folders called â€œwp-imagesâ€ and â€œwp-filezâ€ and give them writable access. (Chmod 766)
Note: You must remember that by default, Postie will only accept email that has a from address that matches your WordPress admin email address! In my case, my mobile phone provider gave me an email address to use for my IMODE service; I edited my author profile and changed my email to this address.
At the top of the Postie options page, there is a test config button. This will check that Postie can connect to the mail server and also write to the attachment folders that we set up earlier.
You can now test Postie, simply send an email (PLAIN TEXT!!) to your secret address (doesnâ€™t have to be from your phone, you may send from Outlook if you wish) and make sure you attach a valid jpg file. Now head back to the Postie options screen and hit the Run Postie button. It should show a status page informing you of any messages that were received and any errors that may have occurred.
Automating the checking process
If your webhost gives you access to secure shell (SSH) or telnet, you may be able to add crontabs. Use the below crontab code.
*/5 * * * * /usr/bin/lynx –source http://www.your-website.com/wp-content/plugins/postie/get_mail.php >/dev/null 2>&1
This automates the Postie checking process every 5 minutes. The above crontab code should be all on one line.
If you donâ€™t have SSH or telnet access and you have access to cPanel (a web hosting control panel) then you may be able to set up crontabs via the web interface, although it all depends on whether your web host has this enabled.
The next step is to test it with your phone, take a picture and attach it to an email to your secret address. Within 5 minutes it should appear on your blog!