Forum Home
Press F1
 
Thread ID: 85201 2007-12-03 06:09:00 Form action gary67 (56) Press F1
Post ID Timestamp Content User
617565 2007-12-03 06:09:00 Hi there
I am writing a web site for my self and want to have a form for people to email me instead of putting my email address down, I have tried the following

<FORM ACTION="mailto:johndoe@aol.com" METHOD="POST" ENCTYPE="text/plain">
Name<BR>
<INPUT TYPE="text" NAME="name" SIZE="40"><BR>
E-mail address<BR>
<INPUT TYPE="text" NAME="email" SIZE="40"><BR>
Subject<BR>
<INPUT TYPE="text" NAME="subject" SIZE="40"><BR>
Your message<BR>
<TEXTAREA NAME="text" COLS="40" ROWS="5"></TEXTAREA><BR>
<INPUT TYPE="submit" VALUE="Send">
<INPUT TYPE="reset" VALUE="Reset">
</FORM>

which gives me the form I want but when I tried to send it, it opened outlook instead.

Question is this because I am working locally and not off of a server (incedently I use FF NOT IE) or am I missing a vital piece of code.

Did a search of other threads and did not turn anything up, any help much appreciated.
gary67 (56)
617566 2007-12-03 07:23:00 mailto: is not a highly standardised system and launching pre-created emails from a browser is difficult. Firefox obviously does not support Outlook for this. If at all possible I would use a mailer script hosted on the server side. You should be able to find some free PHP scripts that will do this. TGoddard (7263)
617567 2007-12-03 08:08:00 If you can't find a script that does what you want I would be happy to write you a PHP one that will do the job.

And yes, as TGoddard says - use a server-side script. A local one will either do something weird and unpredictable, or launch an email client.
Erayd (23)
617568 2007-12-03 20:44:00 Gary

The mailto command is designed to activate your email client to send the email from the users machine, so it will open outlook on your machine

What i think you are trying to do is send an email from your server

To do that you would need to call a mailing script on the server so the first line of your form would look like this

sendmail.cgi being the example mailing script

<form action="sendmail.cgi" method="post">
Morgenmuffel (187)
617569 2007-12-03 21:01:00 if you have php this is a pretty self contained form

www.safalra.com
Morgenmuffel (187)
617570 2007-12-04 06:46:00 Thanks for the help everyone I am trying to learn php so will do what i can and if I get stuck i will be back, I think Nigels answer might be the one though. gary67 (56)
617571 2007-12-11 17:58:00 I downloaded a php form that looks good now all i have to do is get my Apache to load php have downloaded php5 but so far can't get the two to play together. gary67 (56)
1