librelist archives

« back to archive

Example app does not work

Example app does not work

From:
Jan C.
Date:
2012-07-19 @ 09:31
Hi,
I've just checked out MailCore and I'm trying to run the example app
in which I just added the example code from the getting started
http://libmailcore.com/gettingstarted.html

The app crashes with the error

+[CTSMTPConnection
sendMessage:server:username:password:port:useTLS:shouldAuth:error:]:
unrecognized selector

The code is:


 CTCoreMessage *testMsg = [[CTCoreMessage alloc] init];
  [testMsg setTo:[NSSet setWithObject:[CTCoreAddress
addressWithName:@"Monkey" email:@"monkey@monkey.com"]]];
  [testMsg setFrom:[NSSet setWithObject:[CTCoreAddress
addressWithName:@"Someone" email:@"test@someone.com"]]];
  [testMsg setBody:@"This is a test message!"];
  [testMsg setSubject:@"This is a subject"];


CTCoreAccount *account = [[CTCoreAccount alloc] init];
BOOL success = [account connectToServer:@"mail.theronge.com" port:143
connectionType:CTConnectionTypePlain authType:CTImapAuthTypePlain
login:@"test" password:@"none"];
if (!success) {
    // Display the error contained in account.lastError
}



What is wrong?

cheers,
Jan

Re: Example app does not work

From:
Jan C.
Date:
2012-07-19 @ 09:40
hmmm, the example uses a wrong method signature. It should be
"useAuth:NO" instead of "shouldAuth:NO"

BOOL success = [CTSMTPConnection sendMessage:testMsg
server:@"mail.test.com" username:@"test" password:@"test" port:25
useTLS:YES shouldAuth:NO error:&error];




BOOL success = [CTSMTPConnection sendMessage:testMsg
server:@"mail.test.com" username:@"test" password:@"test" port:25
useTLS:YES useAuth:NO error:&error];





On Thu, Jul 19, 2012 at 11:31 AM, Jan C. <chaljan@gmail.com> wrote:
> Hi,
> I've just checked out MailCore and I'm trying to run the example app
> in which I just added the example code from the getting started
> http://libmailcore.com/gettingstarted.html
>
> The app crashes with the error
>
> +[CTSMTPConnection
> sendMessage:server:username:password:port:useTLS:shouldAuth:error:]:
> unrecognized selector
>
> The code is:
>
>
>  CTCoreMessage *testMsg = [[CTCoreMessage alloc] init];
>   [testMsg setTo:[NSSet setWithObject:[CTCoreAddress
> addressWithName:@"Monkey" email:@"monkey@monkey.com"]]];
>   [testMsg setFrom:[NSSet setWithObject:[CTCoreAddress
> addressWithName:@"Someone" email:@"test@someone.com"]]];
>   [testMsg setBody:@"This is a test message!"];
>   [testMsg setSubject:@"This is a subject"];
>
>
> CTCoreAccount *account = [[CTCoreAccount alloc] init];
> BOOL success = [account connectToServer:@"mail.theronge.com" port:143
> connectionType:CTConnectionTypePlain authType:CTImapAuthTypePlain
> login:@"test" password:@"none"];
> if (!success) {
>     // Display the error contained in account.lastError
> }
>
>
>
> What is wrong?
>
> cheers,
> Jan