0

I want to open the Email Settings page in an iPhone application through programs for changing the Email settings.

Is it possible to open the Email Settings page programmatically in iOS?

Does apple gives us such access?

3 Answers3

2

First, configure the URL Schemes in your project. You will find it in Target -> Info -> URL Scheme. click on + button and type prefs in URL Schemes.

Settings in Xcode

Swift 5

UIApplication.shared.open(URL(string: "App-prefs:MAIL&path=ACCOUNTS/ADD_ACCOUNT")!)

Swift 3

UIApplication.shared.open(URL(string:"App-Prefs:root=MAIL&path=ACCOUNTS/ADD_ACCOUNT")!, options: [:], completionHandler: nil)

Swift

UIApplication.sharedApplication().openURL(NSURL(string:"prefs:root=MAIL&path=ACCOUNTS/ADD_ACCOUNT")!)

Objective-C below iOS 13

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"prefs:root=MAIL&path=ACCOUNTS/ADD_ACCOUNT]]

Objective-C

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"App-prefs:MAIL&path=ACCOUNTS/ADD_ACCOUNT"]]
Mario Varchmin
  • 3,704
  • 4
  • 18
  • 33
Shiva
  • 21
  • 2
0

If your device isn't jailbroken there is no way to do this anymore. There was an option to open settings in iOS 5.0 but it's not working anymore. You can only show a hint to the user, but he has to navigate there by himself.

Hannes
  • 3,752
  • 2
  • 37
  • 47
-1

you can use the below

[[UIApplication sharedApplication] openURL: [NSURL URLWithString:@"mailto:sample@test.com"]];

Shaniraaj
  • 59
  • 9