Objective c 未接收使用MessageUI框架发送的电子邮件
我正在使用MessageUI框架发送电子邮件,但在发送时从未收到该电子邮件 我正在导入Objective c 未接收使用MessageUI框架发送的电子邮件,objective-c,messageui,Objective C,Messageui,我正在使用MessageUI框架发送电子邮件,但在发送时从未收到该电子邮件 我正在导入#导入 然后我有下面的代码 - (void)emailFile { if(![MFMailComposeViewController canSendMail]) { UIAlertView *cantSend = [[UIAlertView alloc] initWithTitle:@"Error" message:@"Device not configured to send email" deleg
#导入
然后我有下面的代码
- (void)emailFile
{
if(![MFMailComposeViewController canSendMail]) {
UIAlertView *cantSend = [[UIAlertView alloc] initWithTitle:@"Error" message:@"Device not configured to send email" delegate:self cancelButtonTitle:nil otherButtonTitles:@"OK", nil];
[cantSend show];
[cantSend release];
} else {
MFMailComposeViewController *mailView = [[[MFMailComposeViewController alloc] init] autorelease];
mailView.mailComposeDelegate = self;
[mailView setToRecipients:[NSArray arrayWithObject:@"matthew.inman@cdl.co.uk"]];
[mailView setSubject:@"Test"];
[mailView setMessageBody:@"This is a text message" isHTML:NO];
[self presentModalViewController:mailView animated:YES];
}
}
及
我在控制台中收到“已发送邮件”的消息,但我喜欢我说的我从未收到我正在发送的电子邮件
我查阅了苹果公司的文档,没有找到任何有帮助的东西。其他人能帮我吗。我做错了什么?确保您在设备上测试,电子邮件不会通过模拟器发送。确保您在设备上测试,电子邮件不会通过模拟器发送。我在使用模拟器,我必须从测试部门获取测试电话。谢谢,这是一个很大的帮助。我正在使用模拟器,我将不得不从测试部门得到一个测试电话。谢谢,这是一个很大的帮助。你检查过你正在使用的电子邮件的发送邮箱吗?你检查过你正在使用的电子邮件的发送邮箱吗?
- (void)mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError *)error
{
if(error) {
UIAlertView *errorView = [[UIAlertView alloc] initWithTitle:@"Mail Error" message:[error localizedDescription] delegate:self cancelButtonTitle:nil otherButtonTitles:@"OK", nil];
[errorView show];
[errorView release];
} else {
switch (result) {
case MFMailComposeResultSent:
NSLog(@"Sent Mail");
break;
case MFMailComposeResultSaved:
NSLog(@"Mail Saved");
break;
case MFMailComposeResultCancelled:
NSLog(@"Mail Cancelled");
break;
case MFMailComposeResultFailed:
NSLog(@"Mail Failed");
break;
default:
break;
}
}
[controller dismissModalViewControllerAnimated:YES];
}