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

Last week I took a ’7 days, 1 app’ challenge for the iPad. The aim was to develop and submit an App for the iPad in 7 days. You can read all about the ‘adventure’ on the blog, and there is a summary page here – bottom line, I completed the challenge and bodyCal2 was submitted.

(more…)

Work is progressing on iCalMaker2… one new big change has been to the ‘format’ of the program. This change was made fairly early on, and at the request of the users…

(more…)

Backing up is a serious business. And at MMISoftware we like to keep backups of, well, everything. Over the years we have used a range of methods, including incremental backups to CDs and DVDs, but our current preferred method is to backup to external hard-drives and then remove them to a safe place…

(more…)

Just been doing some work in which we needed to parse some data in the thesnowsite.com database. Basically, the problem was to take the data and then do a series of ‘internal’ consistency and comparison checks. Essentially there were several hundred pieces of data needed to be compared against themselves.

(more…)

and done that!

This story over at ‘A step closer‘ rung true with me. I have encountered similar situations a few times, both with web projects and stand-alone one off programs.

You are asked to produce something (a website, a computer program, whatever) for a client. You discuss the work with the client, you even get the client to sketch out (using PowerPoint or something similar) a user interface.

(more…)

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.)

Fun and games with mailMaker, NSMailDelivery, NSStream and SMTP

As I said in an earlier post, mailMaker is undergoing a serious rewrite.

In an attempt to move away from using clients, such as Apple Mail, to send the final e-mails it was decided to add smtp (simple mail transfer protocol) support directly to the program. That is, to give the program the ability to send the e-mails directly.

First stop was an attempt to use NSMailDelivery. However, NSMailDelivery was found not to be powerful enough (main reason is it insists on using the ‘default’ smtp server in Apple Mail and there is no way to change this behaviour!). So the attempt was abandoned as mailMaker needs to be able to control the smtp server settings.

Mac OS X 10.3 introduced a new API called NSStream. This looked more promising. However as it is a ‘low level’ API it is more problematical to use and effectively means I am having to ‘roll my own’ smtp client. What fun!

Bottom line. Looks like this is going to take longer than I thought!

(There are a number of frameworks available which could be used to add email capabilities to programs but most of these, upon inspection, really seem to be overkill for what I need.)

More fun and games with Applescript and unicode…

I have finally solved the problem of working with Unicode in an Applescript list. I wouldn’t claim the solution is elegant, but it works!

This is, hopefully, the last bit in the puzzle before the release of some new software. Now that this problem has been solved there is some last minute beta testing to do, and if that all goes well, the software should be released early next week.

Once that is done it is back to iCalMaker and chasing a couple of very minor bugs reported last week.

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).