1

Suppose I send a verification code on email and I have a button "check mail" On pressing that I want to just open the email app on the phone directly

edit: trying cordova-app-alunch plugin for it, if you have any suggestions

rawrstar
  • 165
  • 1
  • 14
  • 1
    Use any Modal and how two buttons and then according decision redirect to relevant path – Wasim Jun 24 '22 at 11:37
  • okay for "open in app" button, how do I give the path, please help – rawrstar Jun 24 '22 at 11:39
  • https://stackoverflow.com/questions/2201917/how-can-i-open-a-url-in-androids-web-browser-from-my-application – Wasim Jun 24 '22 at 11:40
  • @Wasim the email app, suppose gmail, it should open directly on button press – rawrstar Jun 24 '22 at 12:07
  • You can't do that, that would be a huge security risk. You can write a text that tells users to check their email. – cloned Jun 24 '22 at 12:30
  • slack does it too https://stackoverflow.com/questions/29206596/launch-mail-app-ios-from-my-own-app#:~:text=You%20can%20launch%20mail%20app%20using%20message%3A%2F%2F%20url,sharedApplication%5D%20canOpenURL%3AmailURL%5D%29%20%7B%20%5B%20%5BUIApplication%20sharedApplication%5D%20openURL%3AmailURL%5D%3B%20%7D – rawrstar Jun 24 '22 at 12:33
  • 1
    in case u are using capacitor, u can use https://capacitorjs.com/docs/apis/app-launcher and launch the app by its package name like (com.google.android.gm) for android and maybe for ios... – Mostafa Harb Jun 25 '22 at 08:14
  • thank you, maybe this could work. how to put an url such that on button press it asks what email app to use – rawrstar Jun 26 '22 at 21:57

3 Answers3

1

this might help

you can also open new mail and give pre selected info

let email = {
      to: 'max@mustermann.de',
      cc: 'erika@mustermann.de',
      bcc: ['john@doe.com', 'jane@doe.com'],
      attachments: [
        'file://img/logo.png',
        'res://icon.png',
        'base64:icon.png//iVBORw0KGgoAAAANSUhEUg...',
        'file://README.pdf'
      ],
      subject: 'Cordova Icons',
      body: 'How are you? Nice greetings from Leipzig',
      isHtml: true
    }

with following you can open and attach the following with one press of a button

// Send a text message using default options
this.emailComposer.open(email);
0

You can use send mail is an node package.

  • 1
    This package is used for sending out an email, while the author looks for a possibility to open the mail app. How to send an email is clearly not part of the question. – JSON Derulo Jun 28 '22 at 10:06
0

you can use it, it navigate to Gmail if logged in.

mailto:SomeMail@blabla.example
Siddhartha Mukherjee
  • 2,703
  • 2
  • 24
  • 29