9

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

Steve Rogers
  • 1,963
  • 2
  • 17
  • 25
  • I've run your code in the iPhone 4.3 simulator (I have OSX Lion & Xcode 4.2.1) and in the "To:" field I get "My Name" as intended. Have you tried sending it to a real mailbox to see what happens? I reckon it'll work. – Luke Nov 25 '11 at 09:03
  • I have Xcode 3.2.6 on Snow Leopard (yes I know I should upgrade but if it's not broke don't fix it etc) with Simulator 4.3 so maybe it's my old Xcode or Mac OS. Can't try sending without a device of course but I'll stop worrying and wait until I get my hands on an iPhone device. That's good news, Luke, thanks. – Steve Rogers Nov 25 '11 at 09:47
  • I would recommend upgrading at some point in the near future - I'm sure Apple will stop accepting submissions through Xcode 3.x at some point, as I believe they've done in the past. Do keep us posted on this current issue though :) – Luke Nov 25 '11 at 10:13
  • I took your advice Luke, 4.2 is pretty cool :) – Steve Rogers Dec 06 '11 at 12:01

2 Answers2

5

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 ;)

Steve Rogers
  • 1,963
  • 2
  • 17
  • 25
  • Glad you solved it! Remember to accept your answer as 'the' answer! – Luke Dec 06 '11 at 12:07
  • Done. (Feels like being on some strange roundabout, nice to know I'm not talking to myself!) Confusing that iPhone has this limit and iPad doesn't, but who are we to argue. – Steve Rogers Dec 06 '11 at 12:31
0

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.

Rahul Chavan
  • 480
  • 3
  • 6