Skip to content

Instantly share code, notes, and snippets.

View mronge's full-sized avatar

Matt Ronge mronge

View GitHub Profile
@mronge
mronge / MailCoreExample.m
Created October 15, 2012 15:29
MailCore Example
CTCoreMessage *msg = [[CTCoreMessage alloc] init];
CTCoreAddress *toAddress = [CTCoreAddress addressWithName:@"Monkey"
email:@"monkey@monkey.com"];
[msg setTo:[NSSet setWithObject:toAddress]];
[msg setBody:@"This is a test message!"];
NSError *error;
BOOL success = [CTSMTPConnection sendMessage:testMsg
server:@"mail.test.com"
username:@"test"
@mronge
mronge / gist:4688812
Last active December 12, 2015 01:08
MCOIMAPSession *session = [[MCOIMAPSession alloc] init];
session.username = @"monkeybreadr@gmail.com";
session.password = @"";
session.hostname = @"imap.gmail.com";
session.port = 993;
session.connectionType = MCOConnectionTypeTLS;
[session checkAccount:^(NSError *err, MCOOperation *op, id response) {
if (err) {
NSLog(@"Oh crap, an error %@", err);
/************** Begin file sqliteInt.h ***************************************/
/*
** 2001 September 15
**
** The author disclaims copyright to this source code. In place of
** a legal notice, here is a blessing:
**
** May you do good and not evil.
** May you find forgiveness for yourself and forgive others.
** May you share freely, never taking more than you give.
MCOIMAPSession *session = [[MCOIMAPSession alloc] init];
session.hostname = @"imap.gmail.com";
session.port = 993;
session.username = @"matt@gmail.com";
session.password = @"password";
session.connectionType = MCOConnectionTypeTLS;
MCOIndexSet *uidSet = [MCOIndexSet indexSetWithRange:MCORangeMake(1,UINT64_MAX)];
MCOIMAPFetchMessagesOperation *fetchOp =
[session fetchMessagesByUIDOperationWithFolder:@"INBOX"
MCOSMTPSession *smtpSession = [[MCOSMTPSession alloc] init];
smtpSession.hostname = @"smtp.gmail.com";
smtpSession.port = 465;
smtpSession.username = @"matt@gmail.com";
smtpSession.password = @"password";
smtpSession.authType = MCOAuthTypeSASLPlain;
smtpSession.connectionType = MCOConnectionTypeTLS;
MCOMessageBuilder *builder = [[MCOMessageBuilder alloc] init];
MCOAddress *from = [MCOAddress addressWithDisplayName:@"Matt R"