1

在我的应用程序中,当用户想要向某人发送电子邮件时,我会预先填写电子邮件地址。我这样做:

NSArray *toRecipients = [NSArray arrayWithObject:@"sales@microsmith.com"];
NSString *subjectStr = [[NSString alloc] initWithFormat:@"test subject"];

MFMailComposeViewController *mailController = [[MFMailComposeViewController alloc] init];
mailController.mailComposeDelegate = self;
[mailController setToRecipients:toRecipients];
[mailController setSubject:subjectStr];
[self presentModalViewController:mailController animated:YES];
[mailController release];

[subjectStr release];

这一切都很好,没有问题。但是,我想知道是否有办法在电子邮件打开后更改“收件人:”字段中显示的内容。

例如,我希望它显示“Microsmith Sales”,而不是显示 - sales@microsmith.com。

那可能吗?

提前致谢

4

1 回答 1

4

是的,只需更改收件人字符串的格式:

NSArray* recipients = [NSArray arrayWithObject: @"Sales Dept <sales@example.com>"];
于 2012-07-17T10:35:10.120 回答