{"id":1334,"date":"2012-06-25T14:34:10","date_gmt":"2012-06-25T10:34:10","guid":{"rendered":"https:\/\/blog.alwawee.ru\/?p=1334"},"modified":"2012-07-09T18:38:32","modified_gmt":"2012-07-09T14:38:32","slug":"how-to-build-mailcore-framework-on-ios","status":"publish","type":"post","link":"https:\/\/blog.alwawee.ru\/?p=1334","title":{"rendered":"How to build MailCore framework on iOS"},"content":{"rendered":"<p>MailCore is a Cocoa e-mail framework built by Matt Ronge that is the core of the e-mail client Kiwi. MailCore provides a nice set of objects for working with IMAP, MIME and SMTP, all of which use the C e-mail library <a href=\"http:\/\/www.etpan.org\/\" title=\"http:\/\/www.etpan.org\/\" target=\"_blank\">LibEtPan<\/a>. <a href=\"http:\/\/cocoadev.com\/wiki\/MailCore\" title=\"http:\/\/cocoadev.com\/wiki\/MailCore\" target=\"_blank\">Here<\/a> is some short information about MailCore. <a href=\"https:\/\/bitbucket.org\/mronge\/mailcore\/src\/d156df4351e7\/Resources\/GETTING_STARTED.txt\" title=\"https:\/\/bitbucket.org\/mronge\/mailcore\/src\/d156df4351e7\/Resources\/GETTING_STARTED.txt\" target=\"_blank\">This<\/a> is short documentation on MailCore from Matt Ronge. Official website is <a href=\"http:\/\/libmailcore.com\/\" title=\"http:\/\/libmailcore.com\/\" target=\"_blank\">here<\/a>.<\/p>\n<p>To make it run on your iOS simulator, do the following: <\/p>\n<ol>\n<li>Download MailCore from GitHub:\n<pre lang=\"Bash\">\r\ngit clone https:\/\/github.com\/mronge\/MailCore.git\r\ncd MailCore\/\r\ngit submodule init\r\ngit submodule update\r\n<\/pre>\n<\/li>\n<li>Build m4, autoconf, automake, libtool on Mac OS X Lion using <a href=\"https:\/\/gist.github.com\/1399288\" title=\"https:\/\/gist.github.com\/1399288\" target=\"_blank\">this post.<\/a><\/li>\n<li>Run update.sh script in MailCore to build and install everything before opening it in Xcode. If you don&#8217;t know, how to run shell scripts, read <a href=\"http:\/\/www.cyberciti.biz\/faq\/run-execute-sh-shell-script\/\" title=\"http:\/\/www.cyberciti.biz\/faq\/run-execute-sh-shell-script\/\" target=\"_blank\">this<\/a><\/li>\n<li>Open MessageSender project in MailCore library. Select MessageSender to build. It will not do anything. To make it sending a test message write the following code in ViewDidLoad:\n<pre lang=\"ObjC\">\r\nCTCoreMessage myMessage = [[CTCoreMessage alloc] init];\r\n    \r\n\/\/ Set To\r\nCTCoreAddress *addrTo1 = [CTCoreAddress address];\r\n[addrTo1 setEmail:@\"Your E-mail1\"];\r\nCTCoreAddress *addrTo2 = [CTCoreAddress address];\r\n[addrTo2 setEmail:@\"E-mail2\"];\r\n\/*CTCoreAddress *addrTo3 = [CTCoreAddress address];\r\n[addrTo3 setEmail:@\"E-mail3\"];*\/\r\n[myMessage setTo:[NSSet setWithObjects:addrTo1, addrTo2, nil]];\r\n  \r\n\/\/ Set From \r\nCTCoreAddress *addrFrom = [CTCoreAddress address];\r\n[addrFrom setEmail:@\"Your E-mail\"];\r\n[addrFrom setName:@\"Your Name\"];\r\n[myMessage setFrom:[NSSet setWithObject:addrFrom]];\r\n   \r\n[myMessage setSubject:@\"Test Mail Core\"];\r\n[myMessage setHTMLBody:@\"This is a test HTML message\"];\r\n   \r\n[CTSMTPConnection sendMessage:myMessage \\\r\nserver:@\"smtp.mail.ru\" username:@\"YourUserName\" \\\r\npassword:@\"YourPassword\" port:587 useTLS:YES useAuth:YES];\r\n<\/pre>\n<\/li>\n<li>\nUse this method to retrieve message subjects from Inbox of your mail: <\/p>\n<pre lang=\"ObjC\">\r\n- (IBAction)retrieveClicked:(id)sender {\r\n    CTCoreAccount *account = [[CTCoreAccount alloc] init];\r\n    [account connectToServer:@\"imap.yandex.ru\" port:143 \\\r\n connectionType:CONNECTION_TYPE_PLAIN authType:IMAP_AUTH_TYPE_PLAIN \\\r\n login:@\"YOUR USERNAME\" password:@\"YOUR PASSWORD\"];\r\n    \r\n    NSSet *subFolders = [account subscribedFolders];\r\n    \r\n    CTCoreFolder *inbox = [account folderWithPath:@\"INBOX\"];\r\n    \r\n    NSSet *messageList = [inbox messageObjectsFromIndex:1 \\\r\n toIndex:0];\r\n    \r\n    for (CTCoreMessage *message in messageList) {\r\n        NSLog(@\"%@\", [message subject]);\r\n    }\r\n}\r\n<\/pre>\n<\/li>\n<\/ol>\n<p><a href=\"http:\/\/libmailcore.com\/\" title=\"http:\/\/libmailcore.com\/\" target=\"_blank\">Official MailCore website. <\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>MailCore is a Cocoa e-mail framework built by Matt Ronge that is the core of the e-mail client Kiwi. MailCore provides a nice set of objects for working with IMAP, MIME and SMTP, all of which use the C e-mail library LibEtPan. Here is some short information about MailCore. This is short documentation on MailCore [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[43],"class_list":["post-1334","post","type-post","status-publish","format-standard","hentry","category-ios","tag-mailcore"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to build MailCore framework on iOS - Denis Kutlubaev<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/blog.alwawee.ru\/?p=1334\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to build MailCore framework on iOS - Denis Kutlubaev\" \/>\n<meta property=\"og:description\" content=\"MailCore is a Cocoa e-mail framework built by Matt Ronge that is the core of the e-mail client Kiwi. MailCore provides a nice set of objects for working with IMAP, MIME and SMTP, all of which use the C e-mail library LibEtPan. Here is some short information about MailCore. This is short documentation on MailCore [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/blog.alwawee.ru\/?p=1334\" \/>\n<meta property=\"og:site_name\" content=\"Denis Kutlubaev\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/alwaweemobile\" \/>\n<meta property=\"article:published_time\" content=\"2012-06-25T10:34:10+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2012-07-09T14:38:32+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/blog.alwawee.com\/?attachment_id=1982\" \/>\n<meta name=\"author\" content=\"Denis Kutlubaev\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Denis Kutlubaev\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/blog.alwawee.ru\\\/?p=1334#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/blog.alwawee.ru\\\/?p=1334\"},\"author\":{\"name\":\"Denis Kutlubaev\",\"@id\":\"https:\\\/\\\/blog.alwawee.ru\\\/#\\\/schema\\\/person\\\/58f1f1f57155b48afab83ba53b3e26a7\"},\"headline\":\"How to build MailCore framework on iOS\",\"datePublished\":\"2012-06-25T10:34:10+00:00\",\"dateModified\":\"2012-07-09T14:38:32+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/blog.alwawee.ru\\\/?p=1334\"},\"wordCount\":168,\"commentCount\":0,\"keywords\":[\"MailCore\"],\"articleSection\":[\"iOS\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/blog.alwawee.ru\\\/?p=1334#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/blog.alwawee.ru\\\/?p=1334\",\"url\":\"https:\\\/\\\/blog.alwawee.ru\\\/?p=1334\",\"name\":\"How to build MailCore framework on iOS - Denis Kutlubaev\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/blog.alwawee.ru\\\/#website\"},\"datePublished\":\"2012-06-25T10:34:10+00:00\",\"dateModified\":\"2012-07-09T14:38:32+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/blog.alwawee.ru\\\/#\\\/schema\\\/person\\\/58f1f1f57155b48afab83ba53b3e26a7\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/blog.alwawee.ru\\\/?p=1334#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/blog.alwawee.ru\\\/?p=1334\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/blog.alwawee.ru\\\/?p=1334#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/blog.alwawee.ru\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to build MailCore framework on iOS\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/blog.alwawee.ru\\\/#website\",\"url\":\"https:\\\/\\\/blog.alwawee.ru\\\/\",\"name\":\"Denis Kutlubaev\",\"description\":\"iOS Development\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/blog.alwawee.ru\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/blog.alwawee.ru\\\/#\\\/schema\\\/person\\\/58f1f1f57155b48afab83ba53b3e26a7\",\"name\":\"Denis Kutlubaev\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/346de75d27c818be0aa7fddeada2e50e30cc15b4da6b3b8110c5d766cd2afa34?s=96&d=mm&r=pg\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/346de75d27c818be0aa7fddeada2e50e30cc15b4da6b3b8110c5d766cd2afa34?s=96&d=mm&r=pg\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/346de75d27c818be0aa7fddeada2e50e30cc15b4da6b3b8110c5d766cd2afa34?s=96&d=mm&r=pg\",\"caption\":\"Denis Kutlubaev\"},\"description\":\"iOS Developer, creator of Tornado Browser and many other popular apps\",\"sameAs\":[\"http:\\\/\\\/dennis.alwawee.com\"],\"url\":\"https:\\\/\\\/blog.alwawee.ru\\\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to build MailCore framework on iOS - Denis Kutlubaev","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/blog.alwawee.ru\/?p=1334","og_locale":"en_US","og_type":"article","og_title":"How to build MailCore framework on iOS - Denis Kutlubaev","og_description":"MailCore is a Cocoa e-mail framework built by Matt Ronge that is the core of the e-mail client Kiwi. MailCore provides a nice set of objects for working with IMAP, MIME and SMTP, all of which use the C e-mail library LibEtPan. Here is some short information about MailCore. This is short documentation on MailCore [&hellip;]","og_url":"https:\/\/blog.alwawee.ru\/?p=1334","og_site_name":"Denis Kutlubaev","article_publisher":"https:\/\/www.facebook.com\/alwaweemobile","article_published_time":"2012-06-25T10:34:10+00:00","article_modified_time":"2012-07-09T14:38:32+00:00","og_image":[{"url":"http:\/\/blog.alwawee.com\/?attachment_id=1982","type":"","width":"","height":""}],"author":"Denis Kutlubaev","twitter_misc":{"Written by":"Denis Kutlubaev","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/blog.alwawee.ru\/?p=1334#article","isPartOf":{"@id":"https:\/\/blog.alwawee.ru\/?p=1334"},"author":{"name":"Denis Kutlubaev","@id":"https:\/\/blog.alwawee.ru\/#\/schema\/person\/58f1f1f57155b48afab83ba53b3e26a7"},"headline":"How to build MailCore framework on iOS","datePublished":"2012-06-25T10:34:10+00:00","dateModified":"2012-07-09T14:38:32+00:00","mainEntityOfPage":{"@id":"https:\/\/blog.alwawee.ru\/?p=1334"},"wordCount":168,"commentCount":0,"keywords":["MailCore"],"articleSection":["iOS"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/blog.alwawee.ru\/?p=1334#respond"]}]},{"@type":"WebPage","@id":"https:\/\/blog.alwawee.ru\/?p=1334","url":"https:\/\/blog.alwawee.ru\/?p=1334","name":"How to build MailCore framework on iOS - Denis Kutlubaev","isPartOf":{"@id":"https:\/\/blog.alwawee.ru\/#website"},"datePublished":"2012-06-25T10:34:10+00:00","dateModified":"2012-07-09T14:38:32+00:00","author":{"@id":"https:\/\/blog.alwawee.ru\/#\/schema\/person\/58f1f1f57155b48afab83ba53b3e26a7"},"breadcrumb":{"@id":"https:\/\/blog.alwawee.ru\/?p=1334#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/blog.alwawee.ru\/?p=1334"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/blog.alwawee.ru\/?p=1334#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/blog.alwawee.ru\/"},{"@type":"ListItem","position":2,"name":"How to build MailCore framework on iOS"}]},{"@type":"WebSite","@id":"https:\/\/blog.alwawee.ru\/#website","url":"https:\/\/blog.alwawee.ru\/","name":"Denis Kutlubaev","description":"iOS Development","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/blog.alwawee.ru\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/blog.alwawee.ru\/#\/schema\/person\/58f1f1f57155b48afab83ba53b3e26a7","name":"Denis Kutlubaev","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/346de75d27c818be0aa7fddeada2e50e30cc15b4da6b3b8110c5d766cd2afa34?s=96&d=mm&r=pg","url":"https:\/\/secure.gravatar.com\/avatar\/346de75d27c818be0aa7fddeada2e50e30cc15b4da6b3b8110c5d766cd2afa34?s=96&d=mm&r=pg","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/346de75d27c818be0aa7fddeada2e50e30cc15b4da6b3b8110c5d766cd2afa34?s=96&d=mm&r=pg","caption":"Denis Kutlubaev"},"description":"iOS Developer, creator of Tornado Browser and many other popular apps","sameAs":["http:\/\/dennis.alwawee.com"],"url":"https:\/\/blog.alwawee.ru\/?author=1"}]}},"_links":{"self":[{"href":"https:\/\/blog.alwawee.ru\/index.php?rest_route=\/wp\/v2\/posts\/1334","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.alwawee.ru\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.alwawee.ru\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.alwawee.ru\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.alwawee.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1334"}],"version-history":[{"count":0,"href":"https:\/\/blog.alwawee.ru\/index.php?rest_route=\/wp\/v2\/posts\/1334\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.alwawee.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1334"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.alwawee.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1334"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.alwawee.ru\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1334"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}