macOS 15.1 MFMailComposeViewController.canSendMail() returns false always

In my Catalyst app I use

func setupMailComposer() {
// Check if the device can send email
guard MFMailComposeViewController.canSendMail() else {
print("Mail services are not available")
showMailErrorAlert()
return
}
// Create and configure the mail composer
let mailComposeVC = MFMailComposeViewController()
mailComposeVC.mailComposeDelegate = self
// Set the email details
mailComposeVC.setToRecipients(["example@example.com"])
mailComposeVC.setSubject("Subject for your email")
mailComposeVC.setMessageBody("This is the body of the email.", isHTML: false)
// Attach a file (optional)
if let filePath = Bundle.main.path(forResource: "example", ofType: "pdf"),
let fileData = try? Data(contentsOf: URL(fileURLWithPath: filePath)) {
mailComposeVC.addAttachmentData(fileData, mimeType: "application/pdf", fileName: "example.pdf")
}
// Present the mail composer
self.present(mailComposeVC, animated: true, completion: nil)
}

Since I have updated to macOS 15.1 the canSendMail() function returns false although I have configured Apple Mail (like before in 15.0 where it worked flawlessly).

Answered by RickMaddy in 834023022

This has been fixed in macOS 15.4.

I'm seeing the same issue in my app as well.

I'm also facing this issue on macOS 15.2. I filed a bug report FB16872976.

This has been fixed in macOS 15.4.

Written by RickMaddy in 834023022
This has been fixed in macOS 15.4.

Cool. And, yeah, that gels with my reading of the bug.

Written by eceronio in 829547022
I filed a bug report FB16872976.

Thank you. This fix was the direct result of bugs like yours from third-party developers.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

macOS 15.1 MFMailComposeViewController.canSendMail() returns false always
 
 
Q