简体   繁体   English

HTML电子邮件表格

[英]HTML E-mail form

So my site is almost done but I'm stuck on the part of sending an email. 因此,我的网站快要完成了,但是我一直无法发送电子邮件。 Everything works, when I fill in the fields. 当我填写字段时,一切正常。 But it always gets saved as a draft so I don't receive the email. 但是它总是保存为草稿,因此我不会收到电子邮件。 Here is my html code: This code is copied from a site. 这是我的html代码:此代码是从网站复制的。

 <form action="mailto:myemailadress@gmail.com" method="post" enctype="text/plain"> Name:<br> <input type="text" name="name"><br> E-mail:<br> <input type="text" name="mail"><br> Comment:<br> <input type="text" name="comment" size="50"><br><br> <input type="submit" value="Send"> <input type="reset" value="Reset"> </form> 

action="mailto:myemailadress@gmail.com" <-- This is not correct. action =“ mailto:myemailadress@gmail.com” <-这是不正确的。

You'll have to point your post submission to a handler php file that will process the form request and submit the email. 您必须将帖子提交指向处理程序php文件,该文件将处理表单请求并提交电子邮件。

Now, some host providers do have a php mailer to make us things easier, eg godaddy https://www.godaddy.com/es/help/using-our-php-form-mailers-on-web-and-classic-hosting-8376 . 现在,某些主机提供商确实有一个php邮件收发器,使我们的工作变得更轻松,例如godaddy https://www.godaddy.com/es/help/using-our-php-form-mailers-on-web-and-classic-托管8376

An example of php mail handler for forms can be found here http://www.freecontactform.com/email_form.php . 可以在http://www.freecontactform.com/email_form.php上找到用于表单的php邮件处理程序的示例。 It has some validation code too. 它也有一些验证代码。

There is a possibility that you're using a server that doesn't support PHP but ASP, .NET, Node.js or some other, in that case i can't help you because i'm not familiar to none of them :) 您使用的服务器可能不支持PHP,但是可能会使用ASP,.NET,Node.js或其他某些服务器,在这种情况下,我无法为您提供帮助,因为我对它们都不熟悉: )

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM