联系表单是否可以在Angular中构建而无需使用外部后端或邮件客户端?

问题描述:

This may be a very stupid question, but is it possible to build a contact form in Angular that can be submitted to an email address without the use of PHP, API's etc - so just simply using TypeScript (or any kind of built in features in the Angular library)?

I'm loathe to build an API solely for the use of sending an email from a contact form, so it looks like the PHP route might be the way to go. However I've had little to no experience with PHP in the past (I've been a C# developer for 10+ years), so my next question is, if I build a PHP page for the sole use of sending an email from a contact form, am I able to test it using Angular's ‘ng serve‘ method?

这可能是一个非常愚蠢的问题,但是可以在Angular中构建一个可以提交的联系表单 一个不使用PHP,API等的电子邮件地址 - 所以只需使用TypeScript(或Angular库中的任何内置功能)? p>

我不愿意为了使用从联系表单发送电子邮件而构建API,所以看起来PHP路由可能就是这样。 然而,我过去几乎没有使用PHP的经验(我已经成为C#开发人员已有10多年了),所以我的下一个问题是,如果我构建一个PHP页面,仅用于发送来自 联系表格,我可以使用Angular的'ng serve'方法进行测试吗? p> div>

Directly sending e-mail by only using angular framework (javascript) is not possible. You have to use an api of some sort.

so my next question is, if I build a PHP page for the sole use of sending an email from a contact form, am I able to test it using Angular's ‘ng serve‘ method?

Yes, you can build a php back-end for e-mail sending and achieve what you wanted