简体   繁体   中英

how to add sender into an HTML coded email?

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.

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. ]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM