MMISoftware Blog
News and views of Mac OS X and iPhone Programming
 
 

iCalMaker on issue 7 of iCreate CD-ROM

The latest issue of iCreate has hit the shelves in the UK and the free CD-ROM features a collection of handy iCal tools. One of which just happens to be iCalMaker!

Fun and games with SMTP and mail protocols

Work is continuing on mailMaker 2.0.

The problem falls in to two areas:

  1. Sending mail directly from mailMaker
  2. Processing the message – files (attachments), ‘includes’, and text layout for correct handling and transmission via e-mail.

Sending mail:

There are three approaches:

1. The ‘mail’ can be sent using Apple events/AppleScript

- This is the approach currently used by mailMaker. However, this can be flakey, slow, and unreliable. Hence the need for a change!

2. Using NSMailDelivery –

This is an API hidden in Cocoa (see here). In principle it works very well, however, the protocol is limited in that it can only use the ‘default’ SMTP (simple mail transfer protocol) server. This may not be ideal. Also, handling of formated text is a problem.

3. ‘Roll your own’ (or use someone elses) SMTP protocols –

Using a framework from another developer can be an option but is limited in the level of control you achieve, therefore I decided to ‘roll my own’…..

‘Roll your own’ –

This is easier said then done…. And progress is slow…. The use of NSStream (can only be used for 10.3 or greater) has really helped. It is now just a question of handling the ‘chatter’ between the client and the server. At present things are working, but error trapping is proving to be difficult.

Processing the message:

Sending ‘plain text’ is easy! Sending ‘rich text’ and attachments is difficult….

Done:

Processing ‘left’, ‘right’, and ‘centred’ text – solved

Encoding attachments – solved

(BASE64 can be such fun!)

Getting the correct MIME information an attached file – solved (well for most types!)

Getting text colour right – solved

To do:

Lots of stuff. Far too much to list here…..

(Thanks to Jeff Franklin for help with the solving the MIME problem.)

Search


 

Subscribe

    Subscribe to MMI news

    Enter your email address:

    Delivered by FeedBurner

    AddThis Social Bookmark Button
 

Categories

 

Archives

 

Spam caught:

 
 

MMISoftware Blog is proudly powered by WordPress
Domain services and hosting by MMISoftware
Entries (RSS) and Comments (RSS).