使用html创建电子邮件表单 [英] create email form using html

查看:75
本文介绍了使用html创建电子邮件表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个HTML表单来发送电子邮件.像这样:当用户输入姓名,电子邮件和消息时,按发送按钮,消息将发送到我的电子邮件地址.我搜了很多.但我找不到任何有用的东西.非常感谢

I want to create a HTML form to send email. something like this: when the user enter name, email and message, press the send button and the message send to my email address. I searched a lot. but I couldn't find anything useful. thanks a lot

<form id="form" action="mailto:mail@mail.com" method="post">
     <p class="column col4"><label for="name">Name:</label><input type="text" name="name" id="name" /></p>
     <p class="column col4"><label for="email">E-mail:</label><input type="text" name="email" id="email" /></p>
     <p class="column col8"><label for="message">Message:</label><textarea rows="5" name="message" id="message"></textarea></p>
     <p class="column col8"><input class="button" type="submit" value="Send" /></p>
                        </form>

这不起作用.按下发送按钮后,Outlook打开,而不是消息,我得到name = ..& message = ....

this doesn't work. after press send button the outlook opens and instead of message i get name=....&message=....

我的服务器支持php.

my server support php.

请帮助我

推荐答案

mailto:作为表单操作非常不可靠,以至于它实际上在WWW上不可用.

mailto: as a form action is highly unreliable, so much so that it is effectively unusable on the WWW.

您需要将操作设置为HTTP(最好是HTTPS)URL,然后使用服务器端技术处理表单提交.

You need to set the action to an HTTP (or, preferably, HTTPS) URL and then handle the form submission using a server side technology.

在任何服务器端编程语言中,读取表单数据和发送电子邮件都是相对琐碎的.因此,您可以先查看服务器在这些方面所支持的内容,然后再使用它.

Reading form data and sending email is relatively trivial in any server side programming language. So you could start by seeing what your server supports along those lines and then just using that.

或者,有(或至少是我上次浏览的)第三方表单邮件服务,允许您将操作设置为托管在其网站上的URL.

Alternatively, there are (or at least there were last time I looked) third party form mailer services which allow you to set the action to a URL hosted on their site.

这篇关于使用html创建电子邮件表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆