Started using WordPress a few days ago and love the clean look/design/code. But it got me thinking about photos, I love photos but hate having to upload stuff and linking to it (CMS style). In fact I’m so lazy, I decided to have a hack at wp-mail.php
What I ended up doing was replacing most of the code in wp-mail.php for wordpress 1.2, didn’t anticipate that when I first started but the results are nice.

This hack is a ‘drop in’ replacement for the current wp-mail.php. It uses pear as a mime compliant email ‘decoder’. What’s cool is that you can attach images inline in your email messages and they’ll be shown as an image in your wordpress article. It does this by decoding the image attachments and writing them to ‘wp-photos’ directory (not in default wp install).

It has all the abilities of the current wp-mail.php plus:

  • Allows image attachments (posts inline)
  • Checks if user email address is in the database (otherwise discards message)
  • Allows other file attachments (zip’s, exe’s, etc)
  • Fairly good cleaner for removing excessive line breaks

I’m planning on more updates, but would love to see this update included in future wordpress releases. Would be happy to maintain it to, I’m fairly sure it complies with most of the coding guidelines I’ve read on the wordpress website.

To install you grab the zip file: wp-mail.zip

  1. Drop the two files (wp-mail.php & mimedecode.php) into a wordpress 1.2 root directory
  2. Create the directories ‘wp-photos’ and ‘wp-filez’ in the wordpress root directory(with writing permissions (probably 0777).

Let me know what you guys think!

161 thoughts on “wp-mail.php

  1. El Estres

    Great hack!! Would it be possible to create a thumbnail from the picture so that the thumbnail is post to the blog and when you click on it the original picture will be shown in a pop-up? Again, a great hack!

  2. Dogs For Sale

    When I seek job on net as a SEO I have found so many jobs regarding wordpress. So , I have planned to learn wordpress with in one month.

Leave a Reply