Thursday, 19 September 2013

MailCore Framework CTSMTPConnection sendMessage

MailCore Framework CTSMTPConnection sendMessage

I have integrated the MailCore (1) Framework and my app is building and
running without any errors. the sendMessage method returns true but there
is no message on the sender account or on the receiver account.
#import <MailCore/MailCore.h>
This is how I am using MailCore
CTCoreMessage *msg = [[CTCoreMessage alloc] init];
CTCoreAddress *toAddress = [CTCoreAddress
addressWithName:[[users objectAtIndex:0] name]
email:[[users objectAtIndex:0] email]];
[msg setTo:[NSSet setWithObject:toAddress]];
[msg
setSubject:NSLocalizedString(@"forgotPasscodeEmailSubject",
nil)];
[msg setBody:@"Test"];
NSError *error;
BOOL success = [CTSMTPConnection sendMessage:msg
server:@"server" username:@"account" password:@"123456"
port:587 connectionType:CTSMTPConnectionTypeStartTLS
useAuth:YES error:&error];
Btw I`m using HostEurope SMTP Server.

No comments:

Post a Comment