MFMailComposeViewController
을 전자 메일로 보내고 있습니다. 또한 연결 가능성 코드를 사용하여 인터넷 연결을 확인했습니다. 인터넷 연결이 정상적으로 작동합니다. 내 코드에서 메일을 보낼 때마다 이메일이 전송되었다는 메시지가 나타납니다. 하지만 나는 어떤 우편도 못 받았어. 앱에서 보내는 이메일이 없습니다. 나는 그 이유가 무엇인지 모르겠다. 누군가이 문제를 없애는 방법을 알고 있다면 해결책을 제공해주십시오.전자 메일 기능이 제대로 작동하지 않습니다.
-(void)sendemail
{
emailBody = @"";
mail = [[MFMailComposeViewController alloc] init];
mail.mailComposeDelegate = self;
[mail setSubject:@"Report"];
NSURL *url = [NSURL URLWithString:imagePath];
NSData *data = [NSData dataWithContentsOfURL:url];
[mail addAttachmentData:data mimeType:@"image/jpg" fileName:@"licence.png"];
NSMutableString *breakline = [[NSMutableString alloc]init];
[breakline appendString:[NSString stringWithFormat:@"<br>"]];
NSArray *toRecipients = [NSArray arrayWithObject:@"[email protected]"];
[mail setToRecipients:toRecipients];
emailBody = [emailBody stringByAppendingFormat:@"%@%@%@%@%@%@%@%@%@%@%@%@%@%@%@%@%@%@%@%@%@%@%@%@%@%@",@"Name: ",namestr,breakline,@"Address: ", addresstr,breakline,@"Landmark: ",landmarkstr,breakline,@"City: ", citystr,breakline,@"State: ", statestr,breakline,@"PIN: ", pinstr,breakline,@"Contact No: ",phonestr,breakline,@"Licence:",licencestr,breakline,@"Email Id", emailstr];
[mail setMessageBody:emailBody isHTML:YES];
if (mail != nil) {
[self presentModalViewController: mail animated: YES];
[mail release];
}
}
감사합니다.
data'가 유효한 데이터가'여부를 확인하시기 바랍니다. – Ilanchezhian
'if ([MFMailComposeViewController canSendMail])' – Ilanchezhian