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 7278607
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T22:53:50+00:00 2026-05-28T22:53:50+00:00

I am working on a mail application. I have a table view in a

  • 0

I am working on a mail application. I have a table view in a view, I need to load a mail page when I click on a button in the same view. I have implemented this using MFMailComposeViewController.

The mail view loaded, but I need to send the content of the table view as body/ attach of the body of mail, instead of icon image.

-(void)displayComposerSheet 
{
    MFMailComposeViewController *mailpage = [[MFMailComposeViewController alloc] init];
    mailpage.mailComposeDelegate = self;
    [mailpage setSubject:@"summary of chronology"];

    // Set up recipients
    NSArray *toRecipients = [NSArray arrayWithObject:@""]; 
    NSArray *ccRecipients = [NSArray arrayWithObjects:@"",nil]; 
    NSArray *bccRecipients = [NSArray arrayWithObject:@""]; 

    [mailpage setToRecipients:toRecipients];
    [mailpage setCcRecipients:ccRecipients];    
    [mailpage setBccRecipients:bccRecipients];

    //Attach an image to the email
      NSString *path = [[NSBundle mainBundle] pathForResource:@"iCon" ofType:@"png"];
      NSData *myData = [NSData dataWithContentsOfFile:path];
     [mailpage addAttachmentData:myData mimeType:@"image/png" fileName:@"iCon"];

    // Fill out the email body text
    NSString *emailBody = @"";
    [mailpage setMessageBody:emailBody isHTML:NO];

    [self presentModalViewController:mailpage animated:YES];
    //[self.navigationController pushViewController:mailpage animated:YES];
    [mailpage release];
}
  • 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-28T22:53:51+00:00Added an answer on May 28, 2026 at 10:53 pm

    Add to your displayComposerMethod this piece of code:

    NSString *emailBody = [self generateHTMLBody];
    [mailpage setMessageBody:emailBody isHTML:YES];
    

    and method like this:

    //assume that you have objects in NSArray* dataArray
    - (NSString *)generateHTMLBody {
        NSString *res = @"<HTML><body><table>\n";
    
        for (int i=0; i < dataArray.count; i++) {
            NSString *tmp = (NSString *)[dataArray objectAtIndex:i];
            res = res = [res stringByAppendingString:@"<tr><td>"];
            res = res = [res stringByAppendingString:tmp];
            res = res = [res stringByAppendingString:@"</td></tr>\n"]; //fix in this line
        }
        res = [res stringByAppendingString:@"</table></body></html>\n"];
        return res;
    }
    // I didn't test this method.
    

    This is of course only an example, and method generateHTMLBody can and should be more sophisticated.

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

Sidebar

Related Questions

I am working on an IMAP client using java mail. We currently have a
I am working in an application where I have to mail the captured video.
I am working on a application where I have to list all user mail
I am working on an application which connects to the mail server using python
Working with an Oracle 9i database from an ASP.NET 2.0 (VB) application using OLEDB.
I have a Play Framework application that sends emails using SMTP server. Now I
I'm working at a helpdesk application where i have a standalone script that queries
I'm working on a UI for a WPF application. I have in my window
I have a doubt in licensing. I am using C# application. Scenario: User gets
I am working on an application where i need to transfer mails from a

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.