简体   繁体   中英

iOS Swift: Open Mail app in inbox emails

Evening, I'm trying to open the inbox mail of the Mail app from a button action...

In the web I saw that is possibile to open the email app the the EmailComposer object.. but I'm not trying to make a new email, I just want the user checks the emails.

Any tips?

I resolved using the following code:

   let mailURL = URL(string: "message://")!
   if UIApplication.shared.canOpenURL(mailURL) {
       UIApplication.shared.open(mailURL, options: [:], completionHandler: nil)
    }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM