diff options
author | 2013-04-04 23:51:34 -0700 | |
---|---|---|
committer | 2013-04-04 23:51:34 -0700 | |
commit | 03dc4ca7e3a6f4fbd73cf9f83a3871a307d043a2 (patch) | |
tree | 1100ce3de341624ea81923d977eac929e478dd03 /src/objc/smtp | |
parent | d036437a499feafdd79994fcaa38d03b50929fe0 (diff) |
Header documentation for SMTP and RFC822.
Diffstat (limited to 'src/objc/smtp')
-rw-r--r-- | src/objc/smtp/MCOSMTPOperation.h | 2 | ||||
-rw-r--r-- | src/objc/smtp/MCOSMTPSendOperation.h | 4 | ||||
-rw-r--r-- | src/objc/smtp/MCOSMTPSession.h | 44 |
3 files changed, 50 insertions, 0 deletions
diff --git a/src/objc/smtp/MCOSMTPOperation.h b/src/objc/smtp/MCOSMTPOperation.h index a833353c..1b3b4b83 100644 --- a/src/objc/smtp/MCOSMTPOperation.h +++ b/src/objc/smtp/MCOSMTPOperation.h @@ -12,6 +12,8 @@ #import <MailCore/MCOOperation.h> +// This is an asynchronous SMTP operation. + @interface MCOSMTPOperation : MCOOperation - (void)start:(void (^)(NSError *error))completionBlock; @end diff --git a/src/objc/smtp/MCOSMTPSendOperation.h b/src/objc/smtp/MCOSMTPSendOperation.h index 02c220d5..2174df91 100644 --- a/src/objc/smtp/MCOSMTPSendOperation.h +++ b/src/objc/smtp/MCOSMTPSendOperation.h @@ -12,10 +12,14 @@ #import <MailCore/MCOSMTPOperation.h> +// This is an asynchronous operation that will send a message through SMTP. + typedef void (^MCOSMTPOperationProgressBlock)(unsigned int current, unsigned int maximum); @interface MCOSMTPSendOperation : MCOSMTPOperation +// This block will be called during the progression of the send of the message +// when some bytes have been sent to the network. @property (nonatomic, copy) MCOSMTPOperationProgressBlock progress; - (void)start:(void (^)(NSError *error))completionBlock; diff --git a/src/objc/smtp/MCOSMTPSession.h b/src/objc/smtp/MCOSMTPSession.h index 9e1c7ac1..b9fb9225 100644 --- a/src/objc/smtp/MCOSMTPSession.h +++ b/src/objc/smtp/MCOSMTPSession.h @@ -22,17 +22,61 @@ @interface MCOSMTPSession : NSObject +// This is the hostname of the POP3 server to connect to. @property (nonatomic, copy) NSString * hostname; + +// This is the port of the POP3 server to connect to. @property (nonatomic, assign) unsigned int port; + +// This is the username of the account. @property (nonatomic, copy) NSString * username; + +// This is the password of the account. @property (nonatomic, copy) NSString * password; + +// This is the authentication type to use to connect. +// MCOAuthTypeSASLNone means that it uses the clear-text password authentication. +// It's the default. +// Note: However, over a encrypted connection, the password will be safe. @property (nonatomic, assign) MCOAuthType authType; + +// This is the encryption type to use. +// See MCOConnectionType for more information. @property (nonatomic, assign) MCOConnectionType connectionType; + +// This is the timeout of the connection. @property (nonatomic, assign) NSTimeInterval timeout; + +// When set to YES, the connection will fail if the certificate is incorrect. @property (nonatomic, assign, getter=isCheckCertificateEnabled) BOOL checkCertificateEnabled; + +// If set to YES, when sending the EHLO or HELO command, use IP address instead of hostname. +// Default is NO. @property (nonatomic, assign, getter=isUseHeloIPEnabled) BOOL useHeloIPEnabled; +// Returns an operation that will send the given message through SMTP. +// It will use the recipient set in the message data (To, Cc and Bcc). +// It will also filter out Bcc from the content of the message. +// +// { +// ... +// // Generate RFC 822 data using MCOMessageBuilder +// MCOPOPOperation * op [session sendOperationWithData:rfc822Data]; +// [op start:^(NSError *error) { +// ... +// }]]; +// - (MCOSMTPSendOperation *) sendOperationWithData:(NSData *)messageData; + +// Returns an operation that will check whether the SMTP account is valid. +// +// { +// ... +// MCOPOPOperation * op [session checkAccountOperationWithFrom:[MCOAddress addressWithMailbox:@"hoa@etpan.org"]]; +// [op start:^(NSError *error) { +// ... +// }]]; +// - (MCOSMTPOperation *) checkAccountOperationWithFrom:(MCOAddress *)from; @end |