【发布时间】:2011-02-26 17:24:39
【问题描述】:
我正在使用此代码发送邮件
MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
picker.mailComposeDelegate = self;
NSString *msgTitle = @"示例标题";
[picker setSubject:msgTitle];
NSArray *toRecipients =[[NSArray alloc] init];
NSArray *ccRecipients =[[NSArray alloc] init];
NSArray *bccRecipients =[[NSArray alloc] init];
[picker setToRecipients:toRecipients];
[picker setCcRecipients:ccRecipients];
[picker setBccRecipients:bccRecipients];
NSString *sum = @"The Email Body string is here";
NSString *emailBody;
emailBody = [NSString stringWithFormat:@"%@",sum];
[picker setMessageBody:emailBody isHTML:YES];
[self presentModalViewController:picker animated:YES];
[选择器发布];
有效,
我想知道,是否需要修改
-(void)launchMailAppOnDevice { NSString *recipients = @"mailto:first@example.com?cc=second@example.com,third@example.com&subject=你好,来自加利福尼亚!"; NSString *body = @"&body=阳光明媚的加利福尼亚正在下雨!";
NSString *email = [NSString stringWithFormat:@"%@%@", 收件人, 正文]; email = [email stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:email]]; }
如果是,那么 我如何在这种方法中进行修改。
请帮助我。
【问题讨论】:
标签: iphone objective-c