MFMailComposeViewController with recipient display-name as well as email address

谁说胖子不能爱 提交于 2019-12-10 03:58:10

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!