Tôi đang cố gắng nhận email mà tôi chọn để gửi email. Nhưng tôi không biết làm thế nào để setToRecipients mà người dùng mà tôi đã chọn trong khung nhìn MFMailComposeViewController.Cách đặt setToRecipients bằng MFMailComposeViewController
if ([MFMailComposeViewController canSendMail])
{
mailer = [[MFMailComposeViewController alloc] init];
mailer.mailComposeDelegate = self;
[mailer setSubject:@"A Message from blablabl"];
NSMutableArray *usersTo = [[NSMutableArray alloc] init];
toRecipients = usersTo;
[mailer setToRecipients:toRecipients];
NSString *emailBody = @"blablablabal";
[mailer setMessageBody:emailBody isHTML:YES];
// only for iPad
// mailer.modalPresentationStyle = UIModalPresentationPageSheet;
[self presentModalViewController:mailer animated:YES];
}
else
{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Failure"
message:@"Your device doesn't support the composer sheet"
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles: nil];
[alert show];
}
Đại biểu http://pastie.org/3281814
Nó doesnt work .... "[email protected] & hơn 1 \ U2026", chỉ có thể nhận được một email vì sau khi ông đặt & n người dùng ... Tôi sẽ cố gắng thay đổi kích thước của uitextfield – user1177647
@Michael Dautermann Không có cách nào để gửi email khi thử nghiệm ứng dụng trong Xcode với trình mô phỏng IOS vì ứng dụng Thư bị thiếu trong Cài đặt trong trình mô phỏng IOS. Khi tôi kết nối thiết bị Iphone với máy Mac của mình và chạy ứng dụng từ Xcode trên thiết bị này, có cách hiển thị màn hình Iphone của tôi trên máy Mac để tôi có thể kiểm soát ứng dụng đang chạy trên thiết bị vật lý bằng chuột và gửi email từ màn hình hiển thị trên mac thay vì chạm vào màn hình trên chính thiết bị Iphone? Cảm ơn nhiều – bibscy