Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updated the example to use the latest SMTP code

  • Loading branch information...
commit 80011253ef3addbff99a78f48b80c4932582dee5 1 parent 3449724
@mronge mronge authored
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];
Please sign in to comment.
Something went wrong with that request. Please try again.