Я использую MFMailComposer. Я отправляю письмо в gmail, MFMailComposer возвращает статус MFMailComposeResultSent. Но я не получил письмо. Я тестировал на iphone4 с 4.3.4. Что я делаю не так?
MFMailComposeViewController *mailPicker = [[MFMailComposeViewController alloc] init];
mailPicker.mailComposeDelegate = self;
// Set the subject of email
[mailPicker setSubject:@"Subject"];
NSString *emailBody = @"Hello from ios";
// This is not an HTML formatted email
[mailPicker setMessageBody:emailBody isHTML:NO];
[self presentModalViewController:mailPicker animated:YES];
[mailPicker release];
- (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error
{
if (result == MFMailComposeResultFailed)
{
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Error" message:[error description] delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alertView show];
[alertView release];
}
if (result == MFMailComposeResultSent)
{
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Success" message:@"Message has been sent" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alertView show];
[alertView release];
}
else
{
[self dismissModalViewControllerAnimated:YES];
}
}
РЕДАКТИРОВАТЬ: Я нашел это в консоли:
DA|Could not open the lock file at /tmp/DAAccountsLoading.lock. We'll load the accounts anyway, but bad things may happen
EDIT2: на iPhone4 с 4.3.4 не работает, но на ipod с 4.3 работает нормально.