Jump to content

Forms


siro

Recommended Posts

Hi, i have recently just created a form in html and used the mailto method to send it to an e-mail, this of course brings up the clients outlook (or other email program) to send it to me. I however do not want this, i want the information to be sent to me through the internet browser to me in an e-mail. I am aware of cgi but i havent had much luck finding any online tutorials for it, also i would like the opinion of others which seems to be the easiest language to develop a cgi in. As for the email, i would also like to send it to my email in a formatted way and not the basic way the mailto method sends, any suggestion of sites (i did try to google it without much success) would be appritiated. Essentially im asking for the following

  • Is it possible to send a formatted e-mail from a form, without using a clients e-mail program using purely html? if not;
  • Should i use CGI to do this or something else? What is the best language to write cgi's in?
  • What are the best sites to help me with the above questions?

Thanks for your time guys and girls

Link to comment
Share on other sites

Right, I know a fair bit about this, no you don't have to have server side programs or scripting, but I would strictly recomend it if you can get it.In my case I can't get it unless I pay extra and so I just stick to making it work with HTML, or any other language I can copy and paste into my HTML file.I don't think however that it is possible to format it, unless you create a macro, that finds and replaces certain things?Anyway, this is the code you will need for it to submit it to your email:

<FORM METHOD=POST ACTION="mailto:youremail.com?subject=Write subject here" ENCTYPE="text/plain">

Insert this instead of your <form> tag...and this:

<INPUT TYPE="submit" VALUE="Submit Post" onclick="window.location='thankyou.html';">   <INPUT TYPE="reset" VALUE="Clear Post">

At the bottom for Submit and reset, the reset will clear all entries, and the submit will send your user to a thankyou page, obviously called thankyou.html.Now the subject bit in the first code will allow all posts to have the same subject, allowing you to perhaps set a rule in your inbox, making all in my case guestbook posts go in to my guestbook folder?Now, as I understand there are a few problems with this, and they are:1. Whether or not you have recieved or the post has been sent, the thankyou page will still appear (most probaly telling your user that you have received their email)2. Not all users may have an email program, hence their hotmail/msn etc. will open promting them to sign in which makes it less automated.3. User may not even have an email at all, and this is where I understand you have to use server side scripts.4. Fourth but finally, most probally the user will recieve a warning telling them that an email will be sent on their behalf, which is unavoidable unless, here it is again, you use server side scripts.I think that PERL is a good lanuage, here is a tutorial in answer to your question.Now, I think I have answered all of your questions, and now for my view on the above codes: If you are just using it as a feedback form or for guestbook posts, then don't worry, but for ordering goods or otherwise you may like to use scripting. As for the problems, I scirt around them by putting a warning on my page about notification of sending an email on the users behalf and I don't worry about perhaps not recieving a post, as it is not a company website and I submit posts manually. OH and there is the slight nag, that the post will not be submitted, you have to do it manually so I suggest putting something about moderating taking anything up to a week, allowing you to manually process anything.

Link to comment
Share on other sites

If your web hosting allows php you might think about php as it has some built in mail functions. I have a contact page that sends email directly through a web form. I pinched the code from somewhere and it was easy to copy & paste it in to my code. (Hint - don't try and re-invent the wheel if someone has already done it!)You can see it here My Webpage in the contact page - send me a message if you want!Also, have you tried scripts.com. There are quite a few webmail codes especially under the php scripts section.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...