MFMailComposer を使用しています。メールを gmail に送信すると、MFMailComposer が MFMailComposeResultSent ステータスを返します。しかし、私は電子メールを受け取っていません。4.3.4 の iphone4 でテストしました。私は何を間違っていますか?
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: 4.3.4 の iPhone4 では動作しませんが、4.3 の iPod では問題なく動作します。