Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using email form without server-side, but have a question

Status
Not open for further replies.

slakker

MIS
Jun 5, 2003
59
US
Hi guys.. EdwardMartinIII did a great job with his FAQ on:

How do I e-mail the contents of a form -- without server-side help? (
I'm using it now, but when the results arrive to you in an email, there's a message at the very top that reads:

MessageBody=

Can I get rid of it?
 
I'm not sure. I tried changing one of the lines in the HTML to

Code:
<input type=&quot;hidden&quot; id=&quot;MessageBody&quot; name=&quot;&quot;></input>

which resulted in just an equals sign appearing.

So, I changed the NAME of the input to something that made more sense:

Code:
<input type=&quot;hidden&quot; id=&quot;MessageBody&quot; name=&quot;Today's Vital Message &quot;></input>

Notice the extra space at the end.

I think this is simply one of the limitations of blindly mailing the contents of a form. You can whitewash it a bit a I've done, or make it seem a part of the report, but unless you want to shift to, say, using Sendmail on a server (which isn't that hard), you're going to have the declaration in the beginning.

Glad it was helpful to you, by the way. If it works out, I'd appreciate a rating.

Cheers,


[monkey] Edward [monkey]

&quot;Cut a hole in the door. Hang a flap. Criminy, why didn't I think of this earlier?!&quot; -- inventor of the cat door
 
Oh yeah. There's all kinds of caveats to the no-CGI-side e-mail. I think I covered most of 'em in the FAQ.

The article makes a good point, though: For ordinary slugs such as I, a mailto link (or the form-based equivalent thereof) is perfectly fine. I happen to ENCOURAGE unstructured e-mail!

For a professional situation, you need to get a little more serious and probably host something on the server.

I expect that anyone who is sufficiently serious to require a server-side solution with error checking and weasel-polishing is also mature enough to get a real host that has some kind of server-side capabilities. (this is the basic flaw in the above article: the sort of person who cannot use a mailto: link because of business requirements is the same sort of person who will be doing server-side e-mails anyway)

Cheers,


[monkey] Edward [monkey]

&quot;Cut a hole in the door. Hang a flap. Criminy, why didn't I think of this earlier?!&quot; -- inventor of the cat door
 
Edward,

It's not a flaw in the article, a lot of designers don't realise the problems that a mailto form can cause, they think that because it works on their system, it will work on any.

Imagine the scenario where you enter a website and fill out a quote form. After you take the time to fill it all out, an error message appears because you do not have a mail client setup. Would you try to contact the company by other means or go elsewhere? I know what I would do.

The big companies are likely to have a server-side script, but it's the smaller companies that can't afford to lose even 1 potential sale because of something this simple.

Hope this helps

Wullie


The pessimist complains about the wind. The optimist expects it to change.
The leader adjusts the sails. - John Maxwell
 
And hosting is so cheap these days that anyone can afford a host which offers server side capabilities, there's no excuse for a business, no matter how small to not have proper hosting.

Ok for a hobbyist on a free site but not for a business. I personally wouldn't do business with a company using a free site.





<!--#sig value=''É'' url='' -->
 
Wullie,

It is a flaw in the article -- a flaw in premise. To paraphrase, the article suggests that using mailto: won't work because of a variety of reasons. Its example is a business that is doing ordering online.

The second paragraph sets the premise that the intended audience of this article is basically &quot;everyone in the world&quot; who feels like publishing online.

The third paragraph addresses the submitting of orders for a business, which is not the typical or common use of the supposed intended audience.

So, either the article is suggesting that everyone use server-side forms and avoid the mailto: link (with which, frankly, I disagree) or it is flawed in its premise of audience (who running a business online where they're taking orders would be so stupid as to use a mailto: link? Wait -- I've seen 'em, I guess).

So that's the flaw.

There is absolutely nothing wrong with using server-side e-mail apps. Some people don't have that knowledge or they don't have the interest or they just want a little link put up, nothing fancy, to send casual e-mail.

Now, an issue I didn't mention before but will since I've learned more, is that the article above is not &quot;informative&quot; so much as a pseudo-informative fear-based ('...you don't want to lose Valuable Customer Data, do you?!') shill for what seems to be a spam-mailer. Yeah, it sends your form contents, but it also sends ads at the header and footer of each letter. Feh.

My business would do better without an uncontrolled ad-insertion in my e-mail and thank-you pages. Yucko.

Cian has an excellent point in that pretty much anyone who wants server-side CGI capability can afford it. I just priced out some hosting solutions and found some very cheap ones that are cheap because they don't support a bunch of Microsoft server-side stuff -- but they do include Perl!

Cheers,


[monkey] Edward [monkey]

&quot;Cut a hole in the door. Hang a flap. Criminy, why didn't I think of this earlier?!&quot; -- inventor of the cat door
 
Thanks for the responses guys.. and Edward, i'll try to mess with that line tomorrow..

Basically I'm using this mailto form on an INTRANET website at work.. I realise that it's a much weaker substitute to a server-side script, but it does perfect job for my Intranet page..

I used to have people click on a link and open up a Microsoft Outlook OFT template file (premade with several questions) and have people fill it out and just hit SEND.

I find this way to be alot cleaner and the end-user doesn't really know what's going on until it starts sending..

I only wish I could &quot;require&quot; certain fields.. i tried using <input name=&quot;require&quot; value=&quot;name,email,etc&quot;> but it didn't work

Any suggestions on this?
 
Well, you can use JavaScript on any form to make sure that it's populated.

My first thought would be to pre-populate it (if possible) and then put something in the onBlur event that verifies the control still contains data and if not, to smack the user and stick the cursor back in. This won't necessarily assure you'll get data you like, but you can have the script check whatever you want it to check.

Of course, in your form declaration, you could also put a quick call to a new function you would write called, oh, &quot;VerifyAnswers&quot; or whatever.

Your first step on that part would be to clearly enumerate exactly what you consider minimum response required.

Cheers,


[monkey] Edward [monkey]

&quot;Cut a hole in the door. Hang a flap. Criminy, why didn't I think of this earlier?!&quot; -- inventor of the cat door
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top