0

I'm working on a React app and I want to create a button that links to https://mail.google.com/mail/u/0/#inbox?compose= where the new composition mail already has a recipient attached.

Since mailto: already does this, I want to find a way to make the mailto use gmail in a new browser tab with the target="_blank" tag inside the same linked element so that the UX is for the user to just get directed to gmail on their browser with a preset recipient in a new composition mail...

The problem I have is that mailto: uses the user's own default mailing app/whatever they set it to.

Since the system I'm working on only operates with gmail accounts that are already in a private database, I'm not too concerned with security. Just want a way to get a preset recipient through a new tab opened in gmail. Is there any good way of doing this?

  • 3
    Mailto will always use whatever the user has set as their default, so probably isn't the best approach. Have you seen this question: [URL to compose a message in Gmail (with full Gmail interface and specified to, bcc, subject, etc.)](https://stackoverflow.com/questions/6548570/url-to-compose-a-message-in-gmail-with-full-gmail-interface-and-specified-to-b)? – DBS Oct 17 '22 at 12:50
  • YES!!! Thanks, worked well! I sadly didn't stumble across that post but similar posts couldn't seem to solve the issue and i was worried that things had changed since 2012, but seems to still be working for now. Thanks again! (im still kinda new to stack overflow, i wanna accept your reference to the other question as a solution but will you still see this response? im not sure) – Cameron Godwin Oct 17 '22 at 17:18

0 Answers0