View Full Version : Mail form code
maglinders
May 12th, 2005, 20:20 PM
I am making a mail form from scratch in html using guidance from thalasson dot com.
I have succeeded with setting
tag <email> and </email> around 'What is your email address?'
and
tag <name> and </name> around 'Your name'
but am having problems with the text box for the message.
I believe I need tags <comment> and </comment> somewhere, but wherever I put them, it fails. Thus...
If I put them round 'Please type your message here', that line becomes hidden. If I put them round the textbox code, the box becomes hidden. If I put them inside the code for the textbox, they appear inside the box. Whatever, I get an error message saying 'You did not enter a comment'.
Arrgh.
Has anyone done this successfully? Or can anyone point me to instant/complete code I can copy?
Many thanks.
Reverend
May 12th, 2005, 20:54 PM
Try this:
<FORM METHOD="POST" ACTION="mailto:your email address here">
Name<BR>
<INPUT TYPE="text" NAME="name" SIZE="30"><BR>
E-mail address<BR>
<INPUT TYPE="text" NAME="subject" SIZE="30"><BR>
Your message<BR>
<TEXTAREA NAME="text" COLS="30" ROWS="5"></TEXTAREA><BR>
<INPUT TYPE="submit">
<INPUT TYPE="reset">
</FORM>
View the attachment below to see what it will look like on a page.
Note: Because of the character encoding we use at TZ you might have to copy/paste that code into a text editor first (e.g notepad) and then copy/paste it from there into your html page.
maglinders
May 12th, 2005, 21:32 PM
Wow. I looked at that and though it must be too simple. Thanks!
Another quick Q: If the email add includes @, spam harversters will find it. Is it true that one can type it thus (in the code):
name (at) domain
and that then the magic of html etc. will make it work as though it used the @ ?
Thanks again
Reverend
May 12th, 2005, 21:49 PM
you can convert your mail address into hex code that a harvester won't recognize.
Some online encoders here:
http://thespameater.com/emailencoder.html?r=0
http://www.u.arizona.edu/~trw/spam/spam2.htm
maglinders
May 12th, 2005, 22:00 PM
You are wonderful. Thank you so much.
maglinders
May 13th, 2005, 00:22 AM
Me again.
Could you check this for me, please?
I can't get it to actually send to me ! :-(
<FORM METHOD="POST" ACTION="mailto:me@me.com">
Name<BR>
<INPUT TYPE="text" NAME="Your name" SIZE="30"><BR>
Your email address<BR>
<INPUT TYPE="text" NAME="subject" SIZE="30"><BR>
Your message<BR>
<TEXTAREA NAME="text" COLS="30" ROWS="5"></TEXTAREA><BR>
<INPUT TYPE="submit" onClick="location.href='thanks.html'"
value="Send">
<INPUT TYPE="reset" value="Reset form">
</FORM>
Many thanks.
maglinders
May 13th, 2005, 00:23 AM
It *does* load the 'thanks' page on click, though.
cash_site
May 13th, 2005, 03:47 AM
LOL, your email address isnt me@me.com... so you dont get the email ;) Also, change the name attribute for the name textbox to name="name" :D
maglinders
May 13th, 2005, 09:13 AM
>LOL, your email address isnt [email]me@me.com<
ino ;) heheh.
OK - working... partly. but now I find that the messages are sitting in my OE outbox. (Never thought to look there, last night!) Should this happen? So, if I go there and send them, fine. But what about random web visitors without a mail client? Will their messages get sent?
The form is at http://www.andrewradley.com/contact6.html if you want to take a look.
(I make websites for love, not money, for struggling young musicians, BTW. They love them, but maybe I am getting too ambitious - heh. I was up till the wee small hours last night <yawn> googling for solutions to mailto: problems and it looks like a minefield!)
Thanks :)
maglinders
May 13th, 2005, 13:37 PM
I asked a friend to send from the form and it did not work. She said this:
>Some reply mails seem to default to my hotmail (where I would like them to
go) and some mails seem to default to my outlook (which I never use but it
comes with the machine and I don't know how to disconnect it. This reply
said "sent" but then the password box came up which I suspected meant that
it was trying to send it through outlook. And I don't know what password it
is talking about - I don't use it and therefore don't have one. You'd do
better to ask someone else, unless you can advise me how to rechannel this
default to go to hotmail.<
Aargh.
maglinders
May 13th, 2005, 13:37 PM
I think she means Outlook express, not Outlook.
maglinders
May 13th, 2005, 17:24 PM
She meant Microsoft password - doh. She's not IT-literate.
However, the principle behind my question remains...
Can I be sure that sending the form from *any* pc (internet cafe... whatever) works?
Thanks.
Reverend
May 13th, 2005, 19:14 PM
Can I be sure that sending the form from *any* pc (internet cafe... whatever) works?
Thanks.Yes. It will be sent to the address you specified in this part of the code:
<FORM METHOD="POST" ACTION="mailto:me@me.com">
maglinders
May 13th, 2005, 20:09 PM
... for your help and reassurance. :cheers:
cash_site
May 16th, 2005, 00:15 AM
Will it though Rev?? I thought the mailto: code only opens the default mail client installed on the PC? Wouldnt she need some sort of mail relay or use Perl/PHP to sendMail() ??
I'm not sure it would work at Internet Cafe/kiosk ?!
Reverend
May 16th, 2005, 18:00 PM
Will it though Rev?? I thought the mailto: code only opens the default mail client installed on the PC? Wouldnt she need some sort of mail relay or use Perl/PHP to sendMail() ??All depends on how the system is set up and which browser is used. But yeah i agree Perl/PHP would be a better option.
maglinders
May 20th, 2005, 22:15 PM
Argh.
I suspected that. The only people I have spoken to have said it launches their em client.
An internet cafe user would need to be logged into their webmail for it to work, then.
Any further thoughts, Rev?
Reverend
May 20th, 2005, 22:39 PM
Any further thoughts, Rev?Do you host the sites that you make ?? Are they all hosted on the same server ??
If so,you could use sendmail as advised earlier.
Can't think of any other options at the moment.
maglinders
May 21st, 2005, 22:13 PM
That's what I wondered. People who have tested my mailform all say it launches their mail client. Suppose they are in an internate cafe and no mail client is live at the time they use the mailform? :confused:
maglinders
May 21st, 2005, 22:15 PM
I only do basic html. Doesn't sendmail require fancy coding? Where can I get how-to on this, please?
adeydas
June 9th, 2005, 03:37 AM
if i might suggest, PHP would be a better option to create a contact form. i have one running at my site, so you might take a look :).
Reverend
June 9th, 2005, 18:09 PM
if i might suggest, PHP would be a better option to create a contact form. i have one running at my site, so you might take a look.So do we. ;)
Curio
June 9th, 2005, 21:11 PM
what like --
<?php
echo "
<HTML>
<BODY>
<FORM METHOD=\"POST\" ACTION=\"mailto:your email address here\">
Name<BR>
<INPUT TYPE=\"text\" NAME=\"name\" SIZE=\"30\"><BR>
E-mail address<BR>
<INPUT TYPE=\"text\" NAME=\"subject\" SIZE=\"30\"><BR>
Your message<BR>
<TEXTAREA NAME=\"text\" COLS=\"30\" ROWS=\"5\"></TEXTAREA><BR>
<INPUT TYPE=\"submit\">
<INPUT TYPE=\"reset\">
</FORM>
</BODY>
</HTML>
";
?>
:D
cash_site
June 10th, 2005, 00:28 AM
Curio, I think that code is what they are currently using (although just html embedded in HTML) but that form will lauch their email client, not actually send it from the server.
Curio
June 10th, 2005, 20:58 PM
It was a joke - I just copied Revs post and php'd it.
:)
But incidentally no-one has mentioned where it's all hosted and what options may be available, frontpage for instance allows pretty much point and click mail form creation and of course there are lots of scripts out there for perl, cgi, php implementations.
-- any method will need a mail program (smtp server of some kind) on the server --
|
|