Hello,

I need a contact form on my website, that will send to my email address what the visitor enter in the form fields. The problem is that I can't run any php scripts.. is there a way to use some html form?

Recommended Answers

All 5 Replies

Yes, but the form will not be pretty as you can't modify the sent data in any way:

<form action=mailto:your@email.address method="POST" enctype="text/plain">

:stymiee> <form action=mailto:your@email.address method="POST" enctype="text/plain"> >_< messy and it's not just a case of being unable to modify data : most browsers will dump you to a default mail client (if one exists) with (at best) the form data in the message body. (assuming that that default mail client is even configured to send mail) the user then has to go click 'send' themselves; that is convolution to the max. at worst, the browser will spit an error, or won't do anything.

if you want to be sure that most users will be able to use your form, get a better hosting provider. if there's some legitimate reason why just ONE hosting provider that you're using won't let you access any kind of server-side script, and you need to keep a site with that hosting provider.. rent one that does let you write script, and use that one solely to send the mail.

<b>Welcome to http://myprimarydomain.tld!</b>
...
<form action="http://myotherdomain.tld/mailscript.php" method="POST" enctype="text/plain">
...
</form>

I'll rent you a one-function script on one of my domains if you're desperate...

Otherwise, you're probably better off just writing your email address on the page and asking people to email you the information if they feel like it. That's pretty much what action=mailto equates to.

Remember, they said they don't have access to PHP. Otherwise a formmail script would have been the obvious choice. :)

Mm. Indeed and agreed. but it's probably worthwhile listing all of the drawbacks of mailto: actions; rather than a simple script somehere ( not neccessarily on the same server where the site is hosted ).

When I had a similar problem ( sendmail blocked ) with some dodgy cheap hosting my old employer used; I set up individiual scripts on my own private full-featured hosting package to handle email forms for clients. As far as I know, those scripts are still in-use...

Perhaps I should start running a third-party service... Set up an account for some silly price like £10 for life ( guaranteed for five years ), and use your own private mailto script, with configurable IP-blocking and a timed IP lock and referer check to protect againt automatic mailbombing... I'm sure such things exist already, but I can't seem to find them by perusing.. It'd almost be money for nothing. ( disapears to plan ).

Thank you for your suggestions! I found a site that offers remotely hosted contact forms, www.emailmeform.com . Basically, I paste the html code in my website, and it calls the php script on their server who sends the email.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.