0

I’m seeing a strange behaviour when sending mail from my app with MFMailComposeViewController.

If the attachment is larger than about 3 MB, the message is created but then remains stuck in Outbox on my iPad running iPadOS 26.0.1.

If I open the stuck draft in Outbox and tap Send immediately, the message is sent successfully.

If I wait for a while before resending, the attachment shrinks to a few hundred bytes and the resend goes out without the file (I think the truncation is related to the MIME type, because it is not happening always).

This happens only on the iPad:

  • iPhone 16 on iOS 26.0.1 – message sends normally
  • iPhone XR on iOS 18.7.1 – message sends normally
  • iPad on iPadOS 26.0.1 – message remains stuck in Outbox with attachments over ~3 MB

Mail settings: default iCloud account (also tried explicit setPreferredSendingEmailAddress("…@icloud.com")), Low Power Mode and Low Data Mode are off.

Has anyone else encountered this behavior on iPadOS 26, or found a reliable workaround?

Here’s the minimal repro I’m using:

import UIKit
import MessageUI

class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view.
    }

    override func viewDidAppear(_ animated: Bool) {
        super.viewDidAppear(animated)
        
        let mailComposer = MFMailComposeViewController()
        mailComposer.setSubject("test")
        mailComposer.setMessageBody("test", isHTML: false)
        
        let repeatedString = String(repeating: "aaaaa aaaaa\n", count: 300000)
        let data = repeatedString.data(using: .utf8)!
                                   
        mailComposer.addAttachmentData(
            data,
            mimeType: "application/octet-stream",
            fileName: "text.txt"
        )
        self.present(mailComposer, animated: true)
    }
}
1
  • After restarting the Mail app I found that my original minimal repro no longer showed the issue. However, I can reproduce the issue always in my app where: - The email has an HTML body that contains a hyperlink. If the link is removed, the issue no longer occurs. - The email has a PDF attachment generated by rendering views into a PDF context. The problem appears only when the PDF is above a certain size. Commented Oct 4 at 6:14

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.