触发 Gmail 撰写 UI React

问题描述 投票:0回答:1

我需要打开 mail.google.com 并使用一些预填充的数据打开撰写 UI 流程。这需要通过 React 应用程序来完成。有没有办法可以实现这一点?

javascript reactjs email gmail next
1个回答
0
投票
const openGmail = () => {

  const subject = encodeURIComponent('Put the subject here');

  const sender = encodeURIComponent('[email protected]');
  const body = encodeURIComponent('E-mail body');

  const url = `https://mail.google.com/mail/?view=cm&fs=1&su=${subject}&to=${sender}&body=${body}`;

  window.open(url, '_blank');
};

这样就够了吗?

© www.soinside.com 2019 - 2024. All rights reserved.