:
#import "SKPSMTPMessage.h"
funtion:
-(void)sendEmail
{
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
testMsg = [[SKPSMTPMessage alloc] init];
testMsg.fromEmail = [defaults objectForKey:@"fromEmail"];
testMsg.toEmail = [defaults objectForKey:@"toEmail"];
testMsg.bccEmail = [defaults objectForKey:@"bccEmal"];
testMsg.relayHost = [defaults objectForKey:@"relayHost"];
testMsg.requiresAuth = [[defaults objectForKey:@"requiresAuth"] boolValue];
if (testMsg.requiresAuth) {
testMsg.login = [defaults objectForKey:@"login"];
testMsg.pass = [defaults objectForKey:@"pass"];
}
testMsg.wantsSecure = [[defaults objectForKey:@"wantsSecure"] boolValue];
testMsg.subject = @"Your Email subject";
testMsg.delegate = self;
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
[testMsg send];
});
}
, :
[self sendEmail]
, ...
!!!