Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 839835
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T05:31:36+00:00 2026-05-15T05:31:36+00:00

I found email composer sample code from iphone OS Ref Library. Here is a

  • 0

I found email composer sample code from iphone OS Ref Library. Here is a code-

Code:

NSArray *toRecipients = [NSArray arrayWithObject:@"first@example.com"];
NSArray *ccRecipients = [NSArray arrayWithObjects:@"second@example.com", @"third@example.com", nil];
NSArray *bccRecipients = [NSArray arrayWithObject:@"fourth@example.com"];

My question is how to take user’s input? Here all email address are predefined in code. so what are the IDs of to, CC, Bcc, subject and body fields?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T05:31:36+00:00Added an answer on May 15, 2026 at 5:31 am

    Use this code. To Give a Email address as user input only.

    MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
    
    picker.mailComposeDelegate = self;
    
    NSString *msgTitle = @"Sample Title";
    
        [picker setSubject:msgTitle];
    
    NSArray *toRecipients =[[NSArray alloc] init];
    
    NSArray *ccRecipients =[[NSArray alloc] init];
    
    NSArray *bccRecipients =[[NSArray alloc] init];
    
    [picker setToRecipients:toRecipients];
    
    [picker setCcRecipients:ccRecipients];  
    
    [picker setBccRecipients:bccRecipients];
    
        NSString *sum = @"The Email Body string is here";
    
    NSString *emailBody;
    
    emailBody = [NSString stringWithFormat:@"%@",sum];
    
    [picker setMessageBody:emailBody isHTML:YES];
    
    [self presentModalViewController:picker animated:YES];
    
    [picker release];
    
    
      -(void)launchMailAppOnDevice
      {
         NSString *recipients = @"mailto:?cc=,&subject=@";
    
         NSString *body = @"&body=";
    
         NSString *email = [NSString stringWithFormat:@"%@%@", recipients, body];
    
        email = [email stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    
        [[UIApplication sharedApplication] openURL:[NSURL URLWithString:email]];
    
      }
    

    Best of luck.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've found this small code that sends email to gmail users. I'd like the
I've just found out that a spammer is sending email from our domain name,
I want to send a reply email. I found this example in microsoft examples
I am writing this simple code to get alert email when "error" found on
I found some great example code some months ago to add a compose button
We found some code being inserted into emails sent by our proprietary email system
I'm trying to send email using PHP. I found many posts here and I
I've recently found a web site where the email address is included within hidden
i want to write application who send email using outlook and i found this
I try to send an email, but I have a problem, however, I found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.