How can I make NativeScript open an email label in its native mail client?

Viewed 2760

I have a simple page/screen. I want to be able to click the email address on the label when open the native mail client on the device. (i.e a mailto: equivalent).

I'm currently only concerned about iOS.

Is this possible?

XML

<Page loaded="pageloaded">
    <GridLayout>
        <StackLayout>
            <Label text="sometest.mail@gmail.com">         
        </StackLayout>
    </GridLayout>
</Page>
2 Answers

Or you could open the default email app while using openUrl method from tns-core-modules/utils/utils

import { openUrl } from "tns-core-modules/utils/utils";

openEmail() {
    openUrl("mailto:test@example.com")
}
Related