Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

610
Views
GMAIL: How to open a existing email in new window if I know its id?

Shortly: How to open email in gmail if I know its id in new window?

Greetings. I get from GMAIL API the id of needed email. I want it to open in separate window by, for example, btn click in my add-on. What I know:

  • what using javascript code -window.location.href = to open url in new window.
  • You can open drafts using URL https://mail.google.com/mail/u/0/#drafts?compose=NeededID but it wont work with for example Sent emails

Any idea how the url should look like so that you can open the email in separate window in gmail.

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Total recall. Solution was found. The solution can be applied to open email in any folder not only in Sent folder. To Open email in new window need its id and thread_id of that email. Also known as messageId and conversationId.
By example messageId looks like this- msg-a:r8357142279172082424
and thread id looks like this - thread-a:r-7561979775658404696

So here is javascript code with URL to open existing email in new window.

  const message = encodeURIComponent(`#${conversationId}|${messageId}`);
  const url = `https://mail.google.com/mail/u/0/#all/${message}`;
  const windowHeight = '540';
  const windowWidth = '960';
  window.open(url, '_blank', `location=yes,height=${windowHeight},width=${windowWidth},scrollbars=yes,status=yes`);

the result is this
already existing email is opened by gmail

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!