I'm looking to call the Gmail app with a preconfigured subject and the body contains HTML using the following:
let gmail = URL(string:"googlegmail:///co?subject=Subject&body=<body><H1>testing</H1></body>")
UIApplication.shared.openURL(gmail!)
This will crash the app, I then resort to:
var messageEncoded1 = "<body><H1>testing</H1></body>".addingPercentEncoding(withAllowedCharacters: .urlFragmentAllowed)
let gmail = URL(string:"googlegmail:///co?subject=Subject&body="+messageEncoded1!")
UIApplication.shared.openURL(gmail!)
And this will create a URL and open Gmail, however, body of the email shows: <body><H1>testing</H1></body>
and not the work testing
like so:
testing
So the question is, is there a way to specify that the body holds HTML so that Gmail can render it as HTML?