在Angular 4中发送没有后端的电子邮件

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

有没有办法在不涉及后端的情况下使用Angular 4发送电子邮件?

我试过formspree,但没有帮助。

<form method="POST" 
  action="https://formspree.io/[email protected]">
  <input type="email" name="email" placeholder="Your email">
  <textarea name="message" placeholder="Test Message"></textarea>
  <button type="submit">Send Test</button>
</form>

或者我是以错误的方式实施它?

任何帮助都会很棒。谢谢。

javascript angular email
1个回答
0
投票

Angular使每个form元素成为一个NgForm隐含地操纵形式的行为。

您需要将NgNoForm属性设置为表单。

<form method="POST" ngNoForm
  action="https://formspree.io/[email protected]">
  <input type="email" name="email" placeholder="Your email">
  <textarea name="message" placeholder="Test Message"></textarea>
  <button type="submit">Send Test</button>
</form>
© www.soinside.com 2019 - 2024. All rights reserved.