我試圖獲取我選擇發送電子郵件的電子郵件。 但我不知道如何setToRecipients哪些用戶,我heve選擇在MFMailComposeViewController視圖。如何使用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];
}
它不工作.... 「[email protected]&1個\ U2026」, 只能得到一個電子郵件,因爲之後他把&n個用戶... 我試圖調整uitextfield的大小 – user1177647 2012-01-30 13:26:54
@Michael Dautermann由於IOS模擬器中的設置缺少郵件應用程序,因此在使用IOS模擬器測試Xcode中的應用程序時無法發送電子郵件。當我將Iphone設備連接到我的Mac,然後從此設備上的Xcode運行應用程序時,是否有方法在Mac上顯示我的Iphone的屏幕,以便我可以控制在物理設備上運行的應用程序鼠標並從Mac上顯示的屏幕發送電子郵件,而不是觸摸Iphone設備本身的屏幕?非常感謝 – bibscy 2017-01-07 13:06:54