Thanks for being a part of WWDC25!

How did we do? We’d love to know your thoughts on this year’s conference. Take the survey here

Mail Extensions

RSS for tag

Use Mail Extensions for composition, message actions, secure email, and content blocking in the Mail app.

Posts under Mail Extensions tag

11 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

Cannot instantiate VIP object/property out of mail app
Is VIP an object contained in the mail or contacts apps/objects? Or is it just a property somewhere? Or is it an independent object? Where is the VIP object? Is it still managed in the mail app or is it just hidden because the design is changing at Apple? The following AppleScript is failing: tell application "Mail" set theVIPs to VIPs with the error: error "Die Variable „VIPs“ ist nicht definiert." number -2753 from "VIPs" (The variable "VIPs" is not defined.". In Mail.sdef documentation and in Contacts.sdef documentation I cannot find any documentation of VIP object or VIP property.
7
0
61
May ’25
IMAP Extension XAPPLEPUSHSERVICE — Access to specific APNS Topic
Hi, I’m looking for guidance on enabling push notifications for new emails in the native iOS Mail app (com.apple.mobilemail). Currently, I send push notifications using macOS Server (formerly OS X Server) Mail, but since it has been discontinued and renewal is no longer possible, I want to transition to the standard method used by email providers to notify the stock Mail app about new messages. To achieve this, I need access to the com.apple.mobilemail.push.com.zuplu APNs topic. This follows the same pattern used by other providers: iCloud: com.apple.mobilemail.push.com.me.mail.castle Fastmail: com.apple.mobilemail.push.com.fastmail Since Fastmail (as a third-party provider) has access to this, I assume there is a way for independent mail providers to integrate with XAPPLEPUSHSERVICE. In the interest of a free market and fair competition, I trust that Apple provides a means for email providers to notify the stock Mail app of IMAP server changes, allowing it to fetch new messages instantly. Under EU competition law, particularly Article 102 TFEU, dominant companies must not engage in anti-competitive behavior, including restricting access to essential services in a discriminatory manner. Furthermore, the Digital Markets Act (DMA) explicitly prohibits gatekeepers from favoring their own services or restricting interoperability without justification. Any insights or official guidance would be greatly appreciated! Thanks, DragonWork
4
36
762
Apr ’25
Apple Mail unsubscribe feature is returning encoded characters in the unsubscribe mail
Hi team, we have a large-scale application in use that sends bulk emails to thousands of users. We adhere to all standard guidelines and protocols, and our email addresses are whitelisted to ensure they are not considered spam. Our users create email alerts on our platform and receive notifications on their respective email addresses. These communications are not unknown, spam, or unsolicited marketing. To maintain trust with our users, we provide an unsubscribe feature as per RFC2369-compliant. We have added list unsubscribe headers with mailTo implementation and sent it to outlook/gmail accounts. However, when unsubscribed, the email seems to be having the encoded characters as is. Whereas the same is working fine in other email clients without any encodings. The headers were implemented according to the List-Unsubscribe headers as specified in the IETF RFC and our emails are purely transactional in nature. This is a critical issue for a large organization like ours and while it works properly on Gmail web and mobile, it is essential for us to check with Apple Mail client as well. This situation undermines our commitment to user trust and compliance. Can anybody assist me why the encoding is showing up? Would like to know whats the process involved to enable the unsubscribe button in Apple mail client application?
1
0
292
Jan ’25
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).
4
1
417
Apr ’25
Correctly using NSAppleScript for Mail.app plugin
Context I'm working on a Mail.app plugin. I would like to disseminate plugin via AppStore. I'm interested in exposing a functionality to user enabling user to choose if plugin should apply to all or selected email account. My intention is to use AppleScript to get a list of available email accounts and expose the list to the end-user via SwiftUI Sourcing account information Apple Script I'm using the following AppleScript tell application "Mail" set accountDict to {} repeat with acc in accounts set accName to name of acc set accEmails to email addresses of acc set accountDict's end to {accName:accEmails} end repeat return accountDict end tell The above generates expected results when executed using Script Editor. Swift Implementation This is still incomplete but shows the overall plan. // // EmailAccounts.swift import Foundation enum EmailScriptError: Error { case scriptExecutionError(String) } struct EmailAccounts { func getAccountNames() -> [String]? { let appleScriptSource = """ tell application "Mail" set accountDict to {} repeat with acc in accounts set accName to name of acc set accEmails to email addresses of acc set accountDict's end to {accName:accEmails} end repeat return accountDict end tell """ var error: NSDictionary? var accountNames: [String] = [] // Create script object, exit if fails guard let scriptObject = NSAppleScript(source: appleScriptSource) else { return nil } // Execute script and store results, nil on error let scriptResult = scriptObject.executeAndReturnError(&error) if error != nil { return nil } // Iterate over results for index in 0...scriptResult.numberOfItems { if let resultEntry = scriptResult.atIndex(index) { if let resultString = resultEntry.stringValue { // Process result handling // accountNames.append(resultString) } } } return accountNames } } Questions Most important one, can I deploy the App on the App Store and use NSAppleScript as shown above? If yes can I use the script in the manner shown above or will I need to store the script in User > Library > Application Scripts location and source it from there. This is outlined in the Scripting from a Sandbox article by Craig Hockenberry, which I cannot link due to being hosted within a not-permitted domain. If yes what entitlements I need to give to the target. I understand that I wouldn't be able to use ScriptingBridge, which feels more robust but wouldn't permit me to deploy the app on the AppStore. My key objective is to programatically identify mail accounts available to Mail.app, if there is a wiser / easier way of doing that I would be more than receptive.
2
0
767
Oct ’24
Can MailKit be used to manage existing messages?
I would like to create a MailKit extension that will allow me to manage my existing messages. I would like to move them around form folder to folder and reqad and update their headers to store some metadata that will be used by the extension. Looking at the documentation for MailKit suggests that I can only implement 4 types of handlers (content blocker, action handler, compose handler and security handler). I can’t see anything in the docs about being able to get a list of messages in the inbox and manipulate them. Am I missing something? I’d love to hear from someone who knows more about this topic before I get into a dead-end rabbit hole. cheers, -tomek
1
0
535
Jan ’25
Outgoing Server Errors
Good evening, I updated to iPadOS 17.6‘s beta couple days ago and it’s preventing me from sending files through MailDrop. Any time I try sending PSD files from my iPad to my desktop, I keep getting errors saying that the Outgoing mail server has failed and that I can add other server addresses in the settings. Anyone else experiencing this?
0
0
503
Jul ’24