Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

zed2

macrumors 6502a
Original poster
Hi all,

I'm writing an application which is pulling archived e-mails from a server..Once I've pulled the RAW message I want to display it.

Can anyone suggest away to push the NSString of the message over to the default mail client and have it display it in a "viewer" window?

Cheers
 
Hi all,

I'm writing an application which is pulling archived e-mails from a server..Once I've pulled the RAW message I want to display it.

Can anyone suggest away to push the NSString of the message over to the default mail client and have it display it in a "viewer" window?

Cheers

You could (Assuming you're using Mac OSX) use a NSTextField to display the contents. As far as I know you won't be able to launch it with a Email program.
 
You could (Assuming you're using Mac OSX) use a NSTextField to display the contents. As far as I know you won't be able to launch it with a Email program.

Yeah, however rendering a MIME message in NSTextField is just not good..

I have however found a solution:

[_messageBody writeToFile:_fileName atomically:TRUE encoding:NSUTF8StringEncoding error:NULL];
[[NSWorkspace sharedWorkspace] openFile:_fileName];

Basically write the string to a temp file and then ask the file system to open the file in the default viewer... saving the file with a ".eml" extension means mail! 😛
 
Yeah, however rendering a MIME message in NSTextField is just not good..

I have however found a solution:

[_messageBody writeToFile:_fileName atomically:TRUE encoding:NSUTF8StringEncoding error:NULL];
[[NSWorkspace sharedWorkspace] openFile:_fileName];

Basically write the string to a temp file and then ask the file system to open the file in the default viewer... saving the file with a ".eml" extension means mail! 😛

That may work for Apple Mail but may not for other like Thunderbird etc. It might of changed, but I remember Thunderbird using some random XML encumbered format.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.