Linux 没有 PHP 的电子邮件联系表

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11419118/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-06 13:46:45  来源:igfitidea点击:

Email contact form without PHP

phpjquerylinuxformsemail

提问by thomasmyrman

I'd like to use a contact form for a website I'm creating, but PHP is not an option since the client doesn't wish to use it. Is there a clever way to work around this somehow, by sending email parameters (which is non-standard) perhaps, or by using an external contact form? Are there any good ones that don't use advertising and are easily modified to a different language for example?

我想为我正在创建的网站使用联系表单,但 PHP 不是一个选项,因为客户不想使用它。是否有一种巧妙的方法来解决这个问题,也许是通过发送电子邮件参数(这是非标准的),或者通过使用外部联系表格?例如,有没有不使用广告并且很容易修改为不同语言的好方法?

Thank you.

谢谢你。

采纳答案by Alex Coplan

There are hundreds of embeddable (most likely iframe-based) solutions for contact forms, which would enable you to get around using a server-side language like PHP. Just a quick google searchwill give you some.

有数百种可嵌入的(最有可能是iframe基于)联系表单的解决方案,它们使您能够使用诸如 PHP 之类的服务器端语言。只需快速谷歌搜索就会给你一些。

Alternatively, you could make a form in HTML, and have a submit button which is actually a mailto:link, and you modify the parameters of that mailto as your form inputs change.

或者,您可以在 HTML 中创建一个表单,并有一个实际上是一个mailto:链接的提交按钮,您可以在表单输入更改时修改该 mailto 的参数。

The only downside of this is that it's not as convenient for the user, as it then opens up their email client and they have to actually send it.

唯一的缺点是它对用户来说不太方便,因为它打开了他们的电子邮件客户端,他们必须实际发送它。

Personally, I would try and persuade the client, but if that isn't possible, then those are your options.

就个人而言,我会尝试说服客户,但如果那不可能,那么这些是您的选择。

回答by Michael

Would something as simple as a mailto formwork?

mailto表单这样简单的东西会起作用吗?

回答by Bhetzie

Check out formspree.

查看表格。

https://github.com/asm-products/formspree

https://github.com/asm-products/formspree

For action you simply put:

对于行动,您只需输入:

<form action="http://formspree.io/[email protected]" method="post">
<input type="text" name="name">
<input type="email" name="_replyto">
<input type="submit" value="Send">

After verifying your email after the first send this will email you the contents of the form. One thing to keep in mind is that this will take the input names. If you do not include input names it won't send you that form field.

在第一次发送后验证您的电子邮件后,这将通过电子邮件向您发送表格的内容。要记住的一件事是,这将采用输入名称。如果您不包括输入名称,它不会向您发送该表单字段。

回答by Ivangrx

Check out www.enformed.io.

查看www.enformed.io

Has a couple of interesting options that formspree does not have( Like redirect out of the box, and a html email editor).

有一些 formpree 没有的有趣选项(比如开箱即用的重定向和 html 电子邮件编辑器)。

回答by Coder

I used Formspree but formspree doesn't allow ajax unless you have Gold Version. It doesn't work on the basic so I am planning on making an account on enformed.io. I still haven't used it but I have heard that t is very good. You can also use alerts fro success and error messages.

我使用了 Formspree,但除非您有黄金版,否则 Formspree 不允许使用 ajax。它在基础上不起作用,所以我计划在 enformed.io 上创建一个帐户。我还没有使用它,但我听说 t 非常好。您还可以使用成功和错误消息的警报。

<form style="margin-left: 6%;" class="email" action="https://www.enformed.io/YOUR_TOKEN" method="post">
  <p>Name:</p>
  <input type="text" name="first_name" />
  <div id="margin" style="height: 0.5%;"></div>
  <p>E-mail:</p>
  <div id="margin" style="height: 0.5%;"></div>
  <input type="text" name="email" />
  <div id="margin" style="height: 0.5%;"></div>
  <p>Subject:</p>
  <div id="margin" style="height: 0.5%;"></div>
  <input type="text" name="subject" />
  <div id="margin" style="height: 0.5%;"></div>
  <p>Message:</p>
  <div id="margin" style="height: 0.5%;"></div>
  <textarea name="message"></textarea>
  <div id="margin" style="height: 0.5%;"></div>
  <button type="submit" class="btn btn-default">Submit Form</button>
</form>