views:

91

answers:

1

I need to send an email from my iPhone app but the name of the sender needs to be included within the body.

I do not know how to do that.

A: 

If you're using MFMailComposeViewController it takes the user's 'default' email account (as set up in Settings) and the email is sent from there. AFAIK, there's no way to obtain that email address (and the name that goes with it) programmatically.

But if your app can somehow get the user to associate their sender email account (via an addressbook picker) then you could use the standard AddressBook APIs to get the sender name and then insert that into the message.

[ It's not clear from your question if you're having problems with sending email, getting user names from contacts, or compositing HTML messages. Perhaps if you edited your question and explained what you're trying to do and what you've tried you'll get a better answer. ]

Ramin
Thanks A lot Ramin :), I'm able to send emails from my app successfully, but one of the requirements is to include the sender name within the email body, I'm going to search how the AddressBook APIs can be used. thanks a lot for the tip !!
Alejandra Gonzalez