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

  • SEARCH
  • Home
  • 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 6984875
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:36:23+00:00 2026-05-27T18:36:23+00:00

I m working on iPhone eBook app. In my app books are created using

  • 0

I m working on iPhone eBook app.

In my app books are created using HTML.
In Index.html page i have to put the email functionality which email(send) the contents of particular chapter.

Now by using webview i show the index.html and in that i have created UIActionSheet which will show the Email button.

Please suggest me that how can i identify the index of different links to send
email of particular chapter.

  • 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-27T18:36:23+00:00Added an answer on May 27, 2026 at 6:36 pm

    Below code will work even if you have not configured email in your device.

    Here is the code:

    - (IBAction) sendEmail:(id)sender
    {
        Class mailClass = (NSClassFromString(@"MFMailComposeViewController"));
    if (mailClass != nil)
    {
        // We must always check whether the current device is configured for sending emails
        if ([mailClass canSendMail])
        {
            [self displayComposerSheet];
        }
        else
        {
            [self launchMailAppOnDevice];
        }
    }
    else
    {
        [self launchMailAppOnDevice];
    }
    }
    
    -(void)displayComposerSheet 
    {
        MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
        picker.mailComposeDelegate = self;
    
        [picker setSubject:@"Hello from DShah!"];
    
        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"]; 
    
        [picker setToRecipients:toRecipients];
        [picker setCcRecipients:ccRecipients];  
        [picker setBccRecipients:bccRecipients];
    
        NSString *path = [[NSBundle mainBundle] pathForResource:@"userdata" ofType:@"abc"];
        NSFileManager *fileManager = [NSFileManager defaultManager];
        NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
        NSString *documentsDirectory = [paths objectAtIndex:0];
        NSString *fullPath = [documentsDirectory stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.abc", @"userdata"]]; 
        NSData *myData = [NSData dataWithContentsOfFile:fullPath];
        [picker addAttachmentData:myData mimeType:@"csv" fileName:@"userdata.abc"];
    
        NSString *emailBody = @"It is raining in sunny California!";
        [picker setMessageBody:emailBody isHTML:NO];
    
        [self presentModalViewController:picker animated:YES];
        [picker release];
    }
    
    -(void)launchMailAppOnDevice
    {
        NSString *recipients = @"mailto:first@example.com&subject=Hello from DShah!";
        NSString *body = @"&body=It is cold in Winter!";
    
        NSString *email = [NSString stringWithFormat:@"%@%@", recipients, body];
        email = [email stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    
        [[UIApplication sharedApplication] openURL:[NSURL URLWithString:email]];
    }
    

    Then implement the Delegate method as below….

    - (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error 
    {
        switch (result)
        {
            case MFMailComposeResultCancelled:
                message = @"Result: canceled";
                break;
            case MFMailComposeResultSaved:
                message = @"Result: saved";
                break;
            case MFMailComposeResultSent:
                message = @"Result: sent";
                break;
            case MFMailComposeResultFailed:
                message = @"Result: failed";
                break;
            default:
                message = @"Result: not sent";
                break;
        }
    
        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Email Demo" message:message delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
        [alert show];
        [alert release];
    
        [self dismissModalViewControllerAnimated:YES];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working an iPhone app which is using CLLocationManager. When a user goes
Im working on an iphone web app using JQTouch , im just wondering what
i'm working on iphone app which will show 4 buttons in first view. on
Greetings! I have a working iPhone app (huzzah!) that uses a MainView.xib containing a
I am working on iphone application in which i have to return the keyboard
I am working on iphone application in which i have to insert multiples values
I have been working with iPhone app as developer and now my PM(Project Manager)
I am working with iPhone app(LandscapeRight Mode), I have added a Image view named
I am working on iPhone app. I have added Navigation bar Background image With
So far I have been working on Iphone applications which use SOAP service to

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.