Accessing Email accounts (SMTP/IMAP/POP)

Is there a way to access email accounts through the Accounts.framework or any other means?

I tried to access accounts with the com.apple.account.SMTP type identifier, but this gives the error message No access plugin was found that supports the account type com.apple.account.SMTP.
Maybe I missed it, but I haven't found any documentation on "access plugins" regarding the Accounts framework, so I am not sure what that error means.

Another approach would be to use AppleEvents to query the account data from AppleMail, but to my knowledge using the AppleEvents entitlement is considered deprecated and won't allow me to publish the app through the AppStore...

Here is the full code I used to test this:
Code Block
self.store = [[ACAccountStore alloc] init];
ACAccountType *typeSmtp = [self.store accountTypeWithAccountTypeIdentifier:@"com.apple.account.SMTP"];
[self.store
requestAccessToAccountsWithType:typeSmtp
options:nil
completion:^(BOOL granted, NSError *error) {
        NSLog(@"granted: %i\n\nerror: %@", (int)granted, error);
}
];