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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T03:53:02+00:00 2026-05-30T03:53:02+00:00

I am using the following code to send an email with the contents of

  • 0

I am using the following code to send an email with the contents of NSData object(with the variable name: data):

MFMailComposeViewController *controller = [[MFMailComposeViewController alloc] init];

[controller setSubject:@"Subject"];
[controller addAttachmentData:data mimeType:@"application/pdf" fileName:@"Attachment"];
[controller setMessageBody:@"Please find attached the connections for..." isHTML:NO];

controller.mailComposeDelegate = self;
[self presentModalViewController:controller animated:YES];

It adds a UIView generated as a pdf as an attachment and sends the email. It is all good, besides a single problem:

When the email is received, along with the attached pdf, there is another attached .txt file whose contents are: “Sent from my iPad” . If I do not attach the pdf, the “Sent from my iPad” message appears in the body of the email, instead in an attached file.

Does anyone have a clue how this can be resolved ? I do not want the text file to be attached in the message.

Regards,

Petar

  • 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-30T03:53:03+00:00Added an answer on May 30, 2026 at 3:53 am

    It seems that when you send an email with an attachment, everything in it is wrapped up as a multipart/mixed message, and everything encoded as Base64, including the message body and the signature! So it looks like this…

    Content-Type: multipart/mixed;
        boundary="_003_81E0DB72B1F643FBAA40D9BCB66A11E4_"
    
    --_003_81E0DB72B1F643FBAA40D9BCB66A11E4_
    Content-Type: text/plain; charset="utf-8"
    Content-Transfer-Encoding: base64
    
    SGkgTW9tIQ==
    

    (that’s "Hi Mom!" encoded as Base64)

    --_003_81E0DB72B1F643FBAA40D9BCB66A11E4_
    Content-Type: application/octet-stream; name="MyAttachment.xlsx"
    Content-Description: MyAttachment.xlsx
    Content-Disposition: attachment; filename="MyAttachment.xlsx"; size=15262
    Content-Transfer-Encoding: base64
    
    UEsDBBQABgAIAAAAIQA3Mb2RgAEAAIQFAAATAAgCW0NvbnRlbnRfVHlwZXNdLnhtbCCiBAIooAAC
    

    snip

    AF81AABkb2NQcm9wcy9hcHAueG1sUEsFBgAAAAANAA0AaAMAACA4AAAAAA==
    
    --_003_81E0DB72B1F643FBAA40D9BCB66A11E4_
    
    Content-Type: text/html; name="ATT00001.htm"
    Content-Description: ATT00001.htm
    Content-Disposition: attachment; filename="ATT00001.htm"; size=91
    Content-Transfer-Encoding: base64
    
    PGh0bWw+PGJvZHkgYmdjb2xvcj0iI0ZGRkZGRiI+PGRpdj48L2Rpdj48ZGl2Pjxicj48YnI+U2VudCBmcm9tIG15IGlQYWQ8L2Rpdj48L2JvZHk+PC9odG1sPg==
    

    (that’s
    <html><body bgcolor="#FFFFFF"><div></div><div><br><br>Sent from my iPad</div></body></html>
    as Base64)

    --_003_81E0DB72B1F643FBAA40D9BCB66A11E4_--
    

    Even if you go to Settings >> Mail, Contacts, Calendars and erase the signature, you still get an empty HTML document attached.

    The right long-term answer will probably be to submit this to Apple as a bug and wait. In the meantime, if this is really a showstopper bug, I’d suggest that you generate the entire multipart/mixed email body yourself, without the signature, and see if that fools MFMailComposeViewController into thinking that the email doesn’t have an attachment. Personally, I think I’m just going to tell my customer to live with it. 🙂

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

Sidebar

Related Questions

I want to send an email with an attachment using the following code (Python
I am using the following code to send an email with a pdf attachment:
I am using following code to create and send email through CGI perl. The
I am using the following code to send an email attachment. I'm using C#,
Using the Apache Commons to send email there is the following code. HtmlEmail email
I am Using Following Code for Send the Email from my application but problem
I am using the following code to send email in codeigniter and would like
I'm using the following code to send an email with attachments: $mime_boundary = <<<--==+X[.md5(time()).];
I am trying to send an email using c# using the following code. MailMessage
I am using the following code to send email to members of my site.

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.