Add a blog by sending a mail to a certain emailadress
For our friends-site I want to create a function where I, and my friends, can send an email to a special emailadres: weblog@domain.com. I want to use the given subject as the blog-title and the mail-body to be the blog-entry. The timestamp the mail was sent must become the timestamp the blog is saved (at least this timestamp开发者_JAVA技巧 must be stored in the database) and only a specified set of mailaddress can be handled (so it's not a public service).
But I don't have a clue how to do this. Are things like this done by cronjobs and imap or something? I'm collecting thoughts on how to realize this. I'm not asking you to provide a fully working code but some suggestions on the requirements would be nice.
A cronjob logs into the email address, downloads any mail, and posts it according to time stamp.
You will need:
- Secret email address. Be sure it's secret because anything that gets sent will get posted
- Blogging engine that you can either manipulate externally, have a decent idea of what the database schema looks like, or are willing to hack into.
- Competent scripting skills
Cronjobs are particularly easy to setup. I was surprised myself at how simplistic it is. Decent tutorial.
精彩评论