logo
backtop

Turtlehead Mailer Up and Running

(Posted 21:23:06 on 23rd December 2007 by Rag)
Well, this weekend's last frantic creativity has been to setup a web front end to my mail server. Rather than simply downloading one of the hundreds of free ones, I decided to write my own. Why? I have no idea at all! It just seemed like a good idea at the time so I did it.

After pulling a very frustrating all nighter to get this up and running, it's now there. It's a little bit more complicated than you think, especially when you want to deal with attachments. You need to build up a Mulit-purpose Internet Mail Extension (MIME) message. So I've read many articles on yet another standard to abide by.

Interesting thing is that the php tools I'm using didn't seem to work out of the box as I thought. There's a function called imap_mail_compose that you use to build up your email (construct it right to conform to the standards), but it doesn't actually tell you how to send the bloody thing once you'd created it. Through trial and error, I managed to get it to work by deconstructing it and putting the header in one bit and the body in another bit of the imap_mail function that actually sends it.

During this endeavor I had problems with my "mulit." No, not a bad haircut spelled badly, but the word "mulit" spelled badly. I needed to set a header type to "TYPEMULTIPART" and screwed up. But that did allow me to find out that you can create your own header records, so I include a turtlehead status with all of mine rather than using something inane like "importance" or "sensitivity."

So why call it Turtlehead Mailer? Well, that's because it's not a technology break through, more of a technology poke through, and it allows me to spread more crap across the cyber world. So look out - if your screen turns brown, you may have been hit by a turtlehead mail.
0 comments

 

This is a Website Blog entry.