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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T06:32:56+00:00 2026-06-03T06:32:56+00:00

I save my objects in NSMutablearray in NSData formate.No i am try to attached

  • 0

I save my objects in NSMutablearray in NSData formate.No i am try to attached in E-mail Body.here is code.

  - (IBAction)sendEmail
     {

   if ([MFMailComposeViewController canSendMail])
  {
       NSArray *recipients = [NSArray arrayWithObject:@"example@yahoo.com"];
       MFMailComposeViewController *controller = [[MFMailComposeViewController 
            alloc] init];
       controller.mailComposeDelegate = self;
       [controller setSubject:@"Iphone Game"];
       NSString *string = [viewArray componentsJoinedByString:@"\n"];
       NSString *emailBody = string; 
       NSLog(@"test=%@",emailBody);
       [controller setMessageBody:emailBody isHTML:YES];
       [controller setToRecipients:recipients];
       [self presentModalViewController:controller animated:YES];
       [controller release];
    }
else 
{
    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Alert" 
            message:@"Your device is not set up for email." delegate:self 
            cancelButtonTitle:@"OK" otherButtonTitles: nil];
    [alert show];   
    [alert release];
}

 }

I get no error,but not see any data in E-mail.in NSLog i see this..2012-05-07 15:33:22.984 Note List[273:207] test=>]please suggest any one better solution for me how i attached my NSMutableArray data in E-mail body..

  • 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-06-03T06:32:57+00:00Added an answer on June 3, 2026 at 6:32 am

    i’m not clear with your question, try this way to set your data. and check the values you are going to set before passing it to composer,

    see this

    MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
        picker.mailComposeDelegate = self;
    
        NSString *mSubject;
    
        if(isInvite)
        {
            mSubject=@"TAPP Invitation";
        }
        else 
        {
            mSubject= @"TAPP email";
        }
    
        [picker setSubject:mSubject];
    
        NSString *mBody;
    
        if(isInvite)
        {
            NSString *pTappId=[[DataModel sharedDataModel] getValueForKey:USER_TAPP_ID];
            NSString *currentUserName=[[DataModel sharedDataModel] getValueForKey:CURRENT_USER_NAME];
             mBody=[NSString stringWithFormat:@"<HTML><BODY>Hi,<br><br>We already know one another, and I would like us to keep in touch.<br><br>Let's connect through TAPP (<a href=\"http://download.mytapp.com\">Download Here</a>) a smarter, private way to exchange and manage contact information.<br><br>Join TAPP and secure your preferred, unique ID before it is too late, and then connect with me. My TAPP ID is %@.<br><br>For more information, <a href=\"http://www.mytapp.com\">click here</a><br><br>Regards,<br><br>%@</BODY></HTML>",pTappId,currentUserName];
        }
        else 
        {
            mBody= [NSString stringWithFormat:@"<HTML><BODY><br /><br />Connected by <a href=http://www.mytapp.com>TAPP</a></BODY></HTML>"];
        }
    
        // Set up recipients
        NSArray *toRecipients = [NSArray arrayWithObject:selectedEmailId]; 
        //NSArray *toRecipients = [NSArray arrayWithObject:@""]; 
    
        [picker setToRecipients:toRecipients];
    
        // Attach an image to the email
        //NSString *path = [[NSBundle mainBundle] pathForResource:@"rainy" ofType:@"png"];
    
        //NSData *myData = UIImagePNGRepresentation(photo.image);
        //[picker addAttachmentData:myData mimeType:@"image/png" fileName:@"abc.png"];
    
        // Fill out the email body text
        NSString *emailBody = mBody;
        [picker setMessageBody:emailBody isHTML:YES];
    
        [self presentModalViewController:picker animated:YES];
    
        [picker release];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to save objects that the user adds to a NSMutableArray that
I am using the following code to save an NSMutableArray to disk: [myArray writeToFile:filePath
I am trying to load and save objects with this piece of code I
I was able to save an NSMutableArray of custom objects to NSUserDefaults by implementing
I need to save objects - instances of classes - in my app like
I want to create own filetype to save objects in my app. Basically, I
I've got a DAO that I used to load and save my domain objects
I want to save my program's DataModel objects to a file, and be able
I want to save one of my entity objects into the session, but as
I am using jQuery to save the values of my javascript objects. I need

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.