带有收件人显示名称和电子邮件地址的 MFMailComposeViewController
我发现我可以,
[picker setToRecipients:[NSArray arrayWithObject:@"My Name <[email protected]>"]];
并且在撰写电子邮件时,它会在“收件人:”字段中很好地显示“我的名字”,并将其正确传递到 [电子邮件受保护],在我的 iPad 设备上。在 iPad 模拟器中看起来也不错(当然不能发送)。
但iPhone模拟器仅在撰写屏幕上显示“1个收件人”。不知道是否可以正常发送,手边没有 iPhone 设备来测试。
还有其他人走这条路吗?有什么方法可以在 iPhone 撰写屏幕上获取显示名称吗?
谢谢
I find that I can
[picker setToRecipients:[NSArray arrayWithObject:@"My Name <[email protected]>"]];
and it nicely displays "My Name" in the To: field when composing the email, and delivers it correctly to [email protected], 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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
好的,明白了。显示名称有 40 个字符的限制。当我弄清楚这一点并在谷歌上搜索“电子邮件显示名称 40”时,我发现还有其他(非 Apple)引用了 40 个字符的限制。可能是 RFC。也许我应该在问题中包含真实显示名称和电子邮件地址;)
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 ;)
如果您没有提供收件人的姓名,那么它也会显示您存储的电子邮件和收件人的姓名。您的 iPad 通讯录中的姓名。
如果您存储名称和将显示联系人的电子邮件。
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.