Michael Sablatura
Michael Sablatura

Reputation: 187

How do I send mail from a static website .htm to a php server on a different website?

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?

Upvotes: 1

Views: 1954

Answers (3)

Tom Fast
Tom Fast

Reputation: 1158

You can use a service like usebasin.com to submit your form to. In other words, setup your form as you usually would, and just point it to your usebasin.com account form like so:

<form action="https://usebasin.com/f/{endpoint-id}" method="POST">
<label for="email-address">Email Address</label>
<input type="email" id="email" name="email" required>
<button type="submit">Submit</button>
</form>

Here are some docs as well: https://usebasin.com/docs

Upvotes: 0

Jared Farrish
Jared Farrish

Reputation: 49208

Use the form action to send to the capture server:

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

Upvotes: 0

knittl
knittl

Reputation: 265547

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>

Upvotes: 6

Related Questions