Interact with third-party iOS mail clients, using custom URL schemes.
For the Swift version follow this link.
Client | URL Scheme | App Store |
---|---|---|
Gmail | googlegmail |
link |
Dispatch | x-dispatch |
link |
Spark | readdle-spark |
link |
Airmail | airmail |
link |
Microsoft Outlook | ms-outlook |
link |
Yahoo Mail | ymail |
link |
Fastmail | fastmail |
link |
Protonmail | protonmail |
link |
Unfortunately, not all mail clients offer URL schemes to be supported by ThirdPartyMailer
. If you’re aware of another candidate, please let us know Swift ObjC.
Manually import the files from the Source folder. For Pod install use:
pod 'ThirdPartyMailerObjC', :git => 'https://github.com/Seoras/ThirdPartyMailer.git'
Open your App's info.plist file and add the key "LSApplicationQueriesSchemes", or update it, with the all the schemes found in ThirdPartyMailer.plist. e.g.
<key>LSApplicationQueriesSchemes</key>
<array>
<string>googlegmail</string>
<string>readdle-spark</string>
<string>x-dispatch</string>
<string>airmail</string>
<string>ms-outlook</string>
<string>ymail</string>
<string>fastmail</string>
<string>protonmail</string>
</array>
Getting the list of available clients:
NSArray *otherMailApps = [ThirdPartyMailer availableClients];
Opening the client (with optional message recipient, subject, and body):
[ThirdPartyMailer openMailClient:client
recipient:@"[email protected]"
subject:@"FooBar"
body:@"Dear Foobar, ..."
completion:^(BOOL success){
NSLog(@"Email sent using %@",client.name);
}];
ThirdPartyMailer (ObjC) is written in Objective C, requires iOS 8.0 and above, Xcode 8.0 and above.
ThirdPartyMailer (Swift) was created by Vincent Tourraine.
ThirdPartyMailer port to Objective C was created by George Taylor.
ThirdPartyMailer is available under the MIT license. See the LICENSE file for more info.