> On Jun 26, 2015, at 1:45 PM, Nick <eveningn...@gmail.com> wrote:
> 
> Would experienced developers suggest is the best way to have an email
> editor view, similar to what Apple Mail app has? What would be the best way
> to give the users a similar to Apple Mail experience?

You’ll need a WebView if you want to handle anything other than plain-text 
messages, since most rich-text email is HTML. (The text/enriched format used to 
be common back in the day, but I think all the current clients send HTML now.)

The Mail composition editor is also a WebView, but with the contentEditable 
property enabled.

> I am trying to let the user edit the message, display attachments like
> pdf's and images.

Inline images are handled as HTML <img> tags. The trick is that the URL in the 
href attribute usually refers to an image stored in another MIME part of the 
email message. This can be a relative link from the HTML body, or an explicit 
link to a MIME part using (IIRC) a “cid:” URL.

It’s also possible to have plain-text emails with inline images; in this case 
the message is multipart and contains a mixture of text and image parts.

I don’t know how inline PDFs are handled, since HTML doesn’t have a tag to 
display them.

—Jens

PS: I don’t want to discourage you, but writing a full-featured email client is 
a _very_ large and complex task. In addition to the message display and 
composition, you’re also going to have to deal with MIME parsing/generation, 
the IMAP protocol (and maybe Exchange), database storage that can handle the 
volume of email people keep around, full-text search, junk mail detection, a 
rule engine… (I used to work on Apple’s Mail team briefly, a long time ago.)
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to