How do I send mail from a static website .htm to a

2019-07-31 20:36发布

问题:

I am currently working on a project where the site is static and the server does not have php installed or anyother dynamic server side language. I've noticed companies like uservoice that somehow get data from a static website to their servers. How can I create a contact form on my static 'no php server' web site and get that contact form data to another server that has php enabled and then send that data with the phpmail function to the specified email address?

回答1:

simply set the action attribute for your form to point to the other server:

<form method="post" action="http://example.com/process.php">
  <input type="text" name="my_textfield" />
  <input type="submit" value="send!" />
</form>


回答2:

Use the form action to send to the capture server:

<form action="http://myphpserver.com/contact.php">


标签: php email static