UIMessage“发送直接邮件”
我正在开发一个考试应用程序。完成考试后,如果该人按下完成按钮,结果将直接发送至该人的电子邮件。UIMessage“发送直接邮件”
我知道如何使用MessageUI
框架,但我不想获得任何撰写视图 - 相反,它应直接转到关注电子邮件。
有谁知道这是否可能?
在此先感谢。
例如语法:
NSString *msgToSend = @"This is an Example Message to be send";
NSString *urlStr = [NSString stringWithFormat:@"www.home.com?method=aMethodName&msg=%@",msgToSend]; //here msg is a parameter of your url string
NSLog(@"%@",urlStr);
NSURLRequest *request = [[NSURLRequest alloc] initWithURL:[NSURL URLWithString:[urlStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]];
希望它让你一个想法......
它帮助我很多,使我的工作变得简单非常感谢:-) – Kumar
我想给邮寄,而不是网站是asNSString // * urlStr = [NSString stringWithFormat:@“[email protected]?method=aMethodName&msg= %@“,msgToSend]; //这是一个正确的方法.. ..?我正在发送邮件,但邮件不会去?????? – Kumar
No no no ...正如你所提到的,你有发送邮件的web服务,所以你必须编写web服务的URL而不是“”[email protected]“。通过这个你可以通过传递字符串(你的消息)作为参数,你的后台系统收到消息,并采取适当的行动发送邮件到所需的位置。 – Maulik
查核在以下线程接受的答案对如何发送电子邮件背景的方法:HTTP:/ /stackoverflow.com/questions/6284599/mfmailcomposeviewcontroller-question-locking-the-fields – Luke