我已經使用了以下顯示mailViewController如何在iphone中自動發送郵件?
-(IBAction)sendMailbuttonTapped {
if([MFMailComposeViewController canSendMail]) {
MFMailComposeViewController *mailCont = [[MFMailComposeViewController alloc] init];
mailCont.mailComposeDelegate = self;
[mailCont setSubject:@"yo!"];
[mailCont setToRecipients:[NSArray arrayWithObject:@"[email protected]"]];
[mailCont setMessageBody:@"Don't ever want to give you up" isHTML:NO];
[self presentModalViewController:mailCont animated:YES];
[mailCont release];
}
}
- (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error {
[self dismissModalViewControllerAnimated:YES];
}
它顯示不錯,但我現在需要的是,我想,當他輕拍按鈕在沒有用戶的知識發送郵件。它必須發送,無需用戶點擊發送選項。
誰能告訴我如何提前
您需要連接到SMTP服務器並與它通話 – Felix 2012-08-11 09:30:47
@ phix23您可以告訴我如何連接到服務器的過程 – 2012-08-11 09:46:44