Is this possible in web programming (such as PHP): Have my website content change when emailed?

Could I write a page that, if I send an email to a specific address (obviously an address associated with my website) containing a specific set of syntax, it receives the email, reads the contents, safety-checks the contents, then alters some part of the website’s content based on the contents of the email.

A theoretical usage might be…

I’m out and about with my iphone. I take a picture. I email it to with the subject “^upload^” or some other code word then a space, then a word denoting a specific ‘album’.

ten seconds later my website has done the work of adding that picture to the appropriate album.

Facebook does that. WordPress has a plugin that lets you email a new post to your blog. If you are using an off-the shelf CMS like that, I’m sure a plugin exists for uploading pictures in the way that you describe.

Post by email is built in to recent WordPress versions. Settings / Writing.

Lobsang: use a pre-existing application to do this rather than building something yourself. There are many ways to get it wrong.

Yes, yes you can.
I run a website where various people send it files via email, it gets the email, saves the file attachment to the file system, updates a table, then later that night picks up the files, processes them and stores them away for later pondering.
However, I have root access to the server, which if you do it the same way I think you’ll need.

The email processing code will not be located on a web page. You need to set up an application which reads the mail files your email server dumps in some folder. And that application can then interpret the email’s content as instructions and move the attachment(s) to some other folder within your web server’s field of view.

Then when somebody pulls up a particular web page that page inventories the folder & displays the images. Or whatever.

Bottom line: the page code will only be dealing with how to display what it finds. How the content gets there is some other code’s problem.

If you’ve never dealt with it, the MIME standards for dealing with email attachments are the mother of all kludges from the heart of the period of explosive growth in the internet in the early 90s. As long as you only have to accept single attachments sent from a single simple email program which is not Outlook, it’s not too hard. Otherwise you’ll need to pay for an email management library compatible with your app environment (e.g. python or .Net or …); the alternative is hundreds of dev hours just to correcly pull the attachment out of the email body.

It (almost) goes without saying that this is a stunningly bad idea from a security perspective.

Yes, you can do this. You will need an application that runs automatically and monitors the email box and does something when it sees a message. That something could be:

  1. Updating a database that your website draws from (e.g. if you’re using PHP, ASP(X), ColdFusion, etc.). E.g. you could have a database table of tblFans and your Fans.aspx page (titled “People who like this site”), could retrieve it’s data dynamically from here (hopefully not directly, but through a data layer). Then, your email monitor updates the table when it receives a message from an email address not in the table, adding them.
  2. Directly load web pages for edit through the operating system and modify their contents with string manipulation.
  3. Do some dynamic programming and edit server forms (e.g. actually modify your PHP code dynamically when you detect an email) (only for the deranged or guru)

I do web development, and the almost certain way we would do it is #1.