我正在使用名为MailPic的“更多iphone 3开发解决iphone SDK 3”中的示例代码。一切都好。没有错误没有警告。
- (IBAction)selectAndMailPic {
UIImagePickerControllerSourceType sourceType = UIImagePickerControllerSourceTypeCamera;
if (![UIImagePickerController isSourceTypeAvailable:
UIImagePickerControllerSourceTypeCamera]) {
sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
}
UIImagePickerController *picker =
[[UIImagePickerController alloc] init];
picker.delegate = self;
picker.allowsEditing = YES;
picker.sourceType = sourceType;
[self presentModalViewController:picker animated:YES];
[picker release];
}
- (void)mailImage:(UIImage *)image {
if ([MFMailComposeViewController canSendMail]) {
MFMailComposeViewController *mailComposer = [[MFMailComposeViewController alloc] init];
mailComposer.mailComposeDelegate = self;
[mailComposer setSubject:NSLocalizedString(@"Here's a picture...", @"Here's a picture...")];
[mailComposer addAttachmentData:UIImagePNGRepresentation(image) mimeType:@"image/png" fileName:@"image"];
[mailComposer setMessageBody:NSLocalizedString(@"Here's a picture that I took with my iPhone.", @"Here's a picture that I took with my iPhone.") isHTML:NO];
[self presentModalViewController:mailComposer animated:YES];
[mailComposer release];
[image release];
}
else
message.text = NSLocalizedString(@"Can't send e-mail...", @"Can't send e-mail...");
}
发送邮件很好,但我还是收不到它。我错过了什么? 发送邮件很好,但我还是收不到它。我错过了什么?
答案 0 :(得分:1)
MFMailComposeViewController 实际上并不发送邮件。它只是将邮件排在 Mail 应用程序的发件箱中,仅此而已。您检查 Mail 应用程序的发件箱,看看邮件是否实际发送过。
手机中的互联网连接可能存在问题。在最糟糕的情况下,从 Mail 应用程序的发件箱重新发送邮件可能对您有帮助!
答案 1 :(得分:0)
MFMailComposer仅用于发送不接收邮件的邮件。您需要阅读MFMailComposer的类引用。
答案 2 :(得分:0)
此应用适用于iphone或不在模拟器上的实时设备。