Я новичок в этой теме может помочь мне ...Iphone-операция не может быть завершена
я посылаю информацию о пользователе на сервер SMTP с помощью Skpsmtpmessage класса. но я получаю: «Операция не может быть завершена». в -(void)messageFailed:(SKPSMTPMessage *)message error:(NSError *)error)
Пожалуйста, помогите мне.
- (void) sendMessage {
SKPSMTPMessage *testMsg = [[SKPSMTPMessage alloc] init];
NSString *myString;
testMsg.relayHost = @"smtp.gmail.com";
testMsg.requiresAuth = YES;
testMsg.login = @"my gmail id";
testMsg.pass = @"my gmail password";
testMsg.subject = [NSString stringWithFormat:@"CLIENT iPhone App - %@", self.navigationItem.title];
testMsg.bccEmail = emailField.text;
testMsg.wantsSecure = YES; // smtp.gmail.com doesn't work without TLS!
testMsg.fromEmail = emailField.text;
NSString *ff = [[UIDevice currentDevice] uniqueIdentifier];
NSString *gg = [[UIDevice currentDevice] model];
NSString *hh = [[UIDevice currentDevice] localizedModel];
NSString *ii = [[UIDevice currentDevice] name];
NSString *jj = [[UIDevice currentDevice] systemName];
NSString *kk = [[UIDevice currentDevice] systemVersion];
NSString *path;
if ([self.navigationItem.title isEqualToString:@"Request Authorization"])
{
path = [[NSBundle mainBundle] pathForResource:@"ThankYou" ofType:@"txt"];
testMsg.toEmail = @"[email protected]";
}
else
{
path = [[NSBundle mainBundle] pathForResource:@"ThankYou2" ofType:@"txt"];
testMsg.toEmail = @"[email protected]";
}
NSString *fileText = [NSString stringWithContentsOfFile:path];
myString = [NSString stringWithFormat:@"LEADERS %@-\n\n%@\n\nName: %@\nCompany: %@\nAddress: %@\nCity: %@\nState: %@\nZip: %@\nPhone: %@\nFax: %@\nEmail: %@\nComments: %@\nRequire New Merchant Account: %@\nReferral Code: %@\nIdentifier: %@\nModel: %@\nLocalized Model: %@\nName: %@\nSystem Name: %@\nSystem Version: %@",self.navigationItem.title,fileText, firstNameField.text,companyField.text,addressField.text,cityField.text,stateField.text,zipCodeField.text,phoneField.text,faxField.text,emailField.text,countryField.text,customerIdField.text,lastNameField.text,ff,gg,hh,ii,jj,kk];
NSDictionary *plainPart = [NSDictionary dictionaryWithObjectsAndKeys:@"text/plain",kSKPSMTPPartContentTypeKey,
myString,kSKPSMTPPartMessageKey,@"8bit",kSKPSMTPPartContentTransferEncodingKey,nil];
testMsg.parts = [NSArray arrayWithObjects:plainPart,nil,nil];
testMsg.delegate= self;
[testMsg send];
[self.navigationController popViewControllerAnimated:TRUE];
}
теперь я получаю другую ошибку как "не logot" в - (пустоте) messageFailed: (SKPSMTPMessage *) сообщение об ошибке: (NSError *) ошибка вы могли бы помочь мне ... –