Email contact form without PHP
Asked Answered
T

5

8

I'd like to use a contact form for a website I'm creating, but PHP is not an option since the client doesn't wish to use it. Is there a clever way to work around this somehow, by sending email parameters (which is non-standard) perhaps, or by using an external contact form? Are there any good ones that don't use advertising and are easily modified to a different language for example?

Thank you.

Tamera answered 10/7, 2012 at 17:57 Comment(3)
So, do you want an external service to submit a request to or do you want to dispatch an email from jquery? Do you have any other server side technology?Pepys
Does the client know best? You need some sort of scripting language to send mail from the server. PHP, Perl, Python, JSP take your pick. Or you can google for free html form to email providers, but free ones will probably take something in return and paid ones are well paid, when you already have a server capable of doing this.Lovato
checkout web3forms.comIntoxicative
C
7

There are hundreds of embeddable (most likely iframe-based) solutions for contact forms, which would enable you to get around using a server-side language like PHP. Just a quick google search will give you some.

Alternatively, you could make a form in HTML, and have a submit button which is actually a mailto: link, and you modify the parameters of that mailto as your form inputs change.

The only downside of this is that it's not as convenient for the user, as it then opens up their email client and they have to actually send it.

Personally, I would try and persuade the client, but if that isn't possible, then those are your options.

Cricoid answered 10/7, 2012 at 18:1 Comment(2)
The thing about using a mailto: link is that it depends on the user having an email client connected to the protocol. I think the point of using a contact form is to make sure the person doesn't have to leave the page.Tamera
@Tamera exactly. the most convenient for the user would be for you to either embed a third-party form, and get them to handle your emails, or for you to indeed use a server-side language (like PHP)Cricoid
R
18

Check out 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.

Remind answered 16/2, 2015 at 7:5 Comment(1)
But where can the user put the message, there is no message field.Bedspread
C
7

There are hundreds of embeddable (most likely iframe-based) solutions for contact forms, which would enable you to get around using a server-side language like PHP. Just a quick google search will give you some.

Alternatively, you could make a form in HTML, and have a submit button which is actually a mailto: link, and you modify the parameters of that mailto as your form inputs change.

The only downside of this is that it's not as convenient for the user, as it then opens up their email client and they have to actually send it.

Personally, I would try and persuade the client, but if that isn't possible, then those are your options.

Cricoid answered 10/7, 2012 at 18:1 Comment(2)
The thing about using a mailto: link is that it depends on the user having an email client connected to the protocol. I think the point of using a contact form is to make sure the person doesn't have to leave the page.Tamera
@Tamera exactly. the most convenient for the user would be for you to either embed a third-party form, and get them to handle your emails, or for you to indeed use a server-side language (like PHP)Cricoid
M
7

Check out www.enformed.io.

Has a couple of interesting options that formspree does not have( Like redirect out of the box, and a html email editor).

Math answered 5/9, 2016 at 14:54 Comment(1)
some years later but I would like to ask if there's a problem having the TOKEN in the HTML page.Avert
C
2

I used Formspree but formspree doesn't allow ajax unless you have Gold Version. It doesn't work on the basic so I am planning on making an account on enformed.io. I still haven't used it but I have heard that t is very good. You can also use alerts fro success and error messages.

<form style="margin-left: 6%;" class="email" action="https://www.enformed.io/YOUR_TOKEN" method="post">
  <p>Name:</p>
  <input type="text" name="first_name" />
  <div id="margin" style="height: 0.5%;"></div>
  <p>E-mail:</p>
  <div id="margin" style="height: 0.5%;"></div>
  <input type="text" name="email" />
  <div id="margin" style="height: 0.5%;"></div>
  <p>Subject:</p>
  <div id="margin" style="height: 0.5%;"></div>
  <input type="text" name="subject" />
  <div id="margin" style="height: 0.5%;"></div>
  <p>Message:</p>
  <div id="margin" style="height: 0.5%;"></div>
  <textarea name="message"></textarea>
  <div id="margin" style="height: 0.5%;"></div>
  <button type="submit" class="btn btn-default">Submit Form</button>
</form>
Conformance answered 7/1, 2020 at 9:47 Comment(0)
R
1

Would something as simple as a mailto form work?

Radley answered 10/7, 2012 at 17:59 Comment(1)
mailto simply open the email client and that is usually not what the customers like to us.Beaufert

© 2022 - 2024 — McMap. All rights reserved.