单击一个按钮,如何使用 Reactjs 重定向到具有自动正文和发件人的 outlook 邮件?

on click of a button how can I re-direct to the outlook mail with automatic body and sender using Reactjs?

sendEmail = () => {
  window.open("mailto:support@example.com?subject=SendMail&body=Description");
};

return (
  <div className="App">
    <button
      type="button"
      className="btn btn-danger"
      onClick={this.sendEmail}
    >
      Send email
    </button>
  </div>
);

我在 ReactJs 中编写了代码,但出现了空白屏幕。请帮忙。

我不知道为什么这对你不起作用,我测试了它并且对我来说效果很好,但请尝试使用锚点 link,如下所示:

mailtoHref = "mailto:support@example.com?subject=SendMail&body=Description";

return (
  <div className="App">
    <a href={this.mailtoHref} className="btn btn-danger">
      Send email
    </a>
  </div>
);