Browse files

Updated the example to use the latest SMTP code

  • Loading branch information...
1 parent 3449724 commit 80011253ef3addbff99a78f48b80c4932582dee5 @mronge mronge committed Nov 25, 2012
Showing with 12 additions and 3 deletions.
  1. +12 −3 Examples/OSX/MessageSender/MessageSender/CTMyController.m
View
15 Examples/OSX/MessageSender/MessageSender/CTMyController.m
@@ -18,7 +18,10 @@ - (IBAction)sendMessage:(id)sender {
[msg setBody:body.stringValue];
BOOL auth = ([useAuth state] == NSOnState);
- BOOL tls = ([useTLS state] == NSOnState);
+ CTSMTPConnectionType connectionType = CTSMTPConnectionTypePlain;
+ if ([useTLS state] == NSOnState) {
+ connectionType = CTSMTPConnectionTypeStartTLS;
+ }
NSString *serverValue = server.stringValue;
NSString *usernameValue = username.stringValue;
@@ -27,8 +30,14 @@ - (IBAction)sendMessage:(id)sender {
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
NSError *error;
- BOOL success = [CTSMTPConnection sendMessage:msg server:serverValue username:usernameValue
- password:passwordValue port:portValue useTLS:tls useAuth:auth error:&error];
+ BOOL success = [CTSMTPConnection sendMessage:msg
+ server:serverValue
+ username:usernameValue
+ password:passwordValue
+ port:portValue
+ connectionType:connectionType
+ useAuth:auth
+ error:&error];
if (!success) {
dispatch_async(dispatch_get_main_queue(), ^{
[NSApp presentError:error];

0 comments on commit 8001125

Please sign in to comment.