从没有 php 的 html 表单发送电子邮件

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/17937414/
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-25 16:41:30  来源:igfitidea点击:

Send email from html form without php

phphtmlformsemail

提问by maxhud

Is there a service that allows you to post a form to it from an html page (my php mail isn't working temporarily and I need a quick solution) and it will automatically send an email with specified content to a specified address?

是否有一项服务允许您从 html 页面向其发布表单(我的 php 邮件暂时无法工作,我需要一个快速解决方案)并且它会自动将包含指定内容的电子邮件发送到指定地址?

The address it comes from is insignificant.

它来自的地址无关紧要。

采纳答案by twinlakes

There's no perfect solution because they are still encoded as url variables. Setting the enctype to plaintext makes it somewhat more acceptable.

没有完美的解决方案,因为它们仍然被编码为 url 变量。将 enctype 设置为纯文本使其更容易接受。

<form action="mailto:[email protected]" enctype="text/plain">
<textarea></textarea>
</form>

回答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 Kevin

I don't believe you can within the website. As the others stated, you can use mailto:[email protected], but that is not automatic and it opens the user's default email editor. You could use http://www.emailmeform.com/though. It lets you make a form and it will send an email to you.

我不相信你可以在网站内。正如其他人所说,您可以使用 mailto:[email protected],但这不是自动的,它会打开用户的默认电子邮件编辑器。不过,您可以使用http://www.emailmeform.com/。它可以让你制作一个表格,它会向你发送一封电子邮件。

回答by DevZer0

in your html form provide a mailtoaction.

在您的 html 表单中提供一个mailto操作。

for example

例如

<form action="mailto:[email protected]">
.....
</form>