问题
I find that I can
[picker setToRecipients:[NSArray arrayWithObject:@"My Name <myname@example.com>"]];
and it nicely displays "My Name" in the To: field when composing the email, and delivers it correctly to myname@example.com, on my iPad device. Looks good in the iPad simulator too (can't send though of course).
But the iPhone simulator just shows "1 recipient" on the compose screen. Don't know whether it would send it ok or not, don't have an iPhone device handy to test that.
Has anyone else gone down this path? Any way of getting the display-name on the iPhone compose screen?
Thanks
回答1:
OK got it. There is a 40-character limit on the display name. When I figured this out and googled "email display-name 40" I find there other (non-Apple) references to a 40-char limit. RFC possibly. Perhaps I should have included the real display-name and email address in my question ;)
回答2:
If you don't give the name of the recipient then also it will display the name as you have stored the email & name in your iPAD contacts. If you store the name & email in contact it will display.
来源:https://stackoverflow.com/questions/8266518/mfmailcomposeviewcontroller-with-recipient-display-name-as-well-as-email-address