How to open Gmail app (Not creating email just only open inbox) in url_launcher?

Viewed 1086
mailto:<email address>?subject=<subject>&body=<body>

This one creates an email. I want to just open the Gmail app (inbox) with url_launcher package. Is it possible?

3 Answers

You can simple use

launch("https://mail.google.com/mail/u/0/#inbox")

This will open the inbox

Yes, it is possible with the url_launcher package.

To open the gmail app (inbox) with pre-filled mailto, subject and body, you can do something like this:

final Uri params = Uri(
  scheme: 'mailto',
  path: 'mailto@gmail.com',
  query: 'subject=This is the subject&body=this is body',
);
final url = params.toString();
launch(url);
Related