【发布时间】:2012-08-11 09:23:03
【问题描述】:
我已经使用以下来显示mailViewController
-(IBAction)sendMailbuttonTapped {
if([MFMailComposeViewController canSendMail]) {
MFMailComposeViewController *mailCont = [[MFMailComposeViewController alloc] init];
mailCont.mailComposeDelegate = self;
[mailCont setSubject:@"yo!"];
[mailCont setToRecipients:[NSArray arrayWithObject:@"surendherbtech@gmail.com"]];
[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 服务器并与之对话
-
@phix23 可以告诉我连接服务器的过程
标签: iphone objective-c xcode mfmailcomposeviewcontroller