Jump to content
xisto Community
Plenoptic

Mailto Error

Recommended Posts

Well I have been very busy trying to get my site up and running and I was trying to make a form for people to fill out to apply to affiliate with my site but when they click submit it opens up a new email instead of sending the form. This is the code and link.

http://forums.xisto.com/no_longer_exists/

<form method="get" action="mailto:plenopti@plenopticdesign.be">What is your name?<BR><INPUT NAME="name" VALUE="enter name here" TYPE="text"><P>What is your site name?<BR><INPUT NAME="Site Name" VALUE="Young" Type="text" SELECTED><br><INPUT VALUE="Send" TYPE="submit"><INPUT VALUE="Clear This Form" TYPE="reset"></FORM>

Share this post


Link to post
Share on other sites

Plenoptic, that is because you are using a HTML Form. HTML Forms don't have the power to send forms only, open an email and send it. If you'd like it to send the form, you need to use a PHP Form. Or i think you can add so ASP to above code that will do it. But the above is not going to do it for you without opening email and sending it like a normal email.

Share this post


Link to post
Share on other sites

Ok thanks. I will have to try and find a tutorial. If anyone could help me find a tutorial I would greatly appreciate it.

Share this post


Link to post
Share on other sites

Try this.

in your code you must change a few things
change this:

<form method="get" action="mailto:plenopti@plenopticdesign.be">
to this:
<form method="post" action="makemymail.php">
this will submit this informaiton along to the file maikemymail.php, you could call it anything you want, but this should do.

next change this:
<INPUT NAME="Site Name" VALUE="Young" Type="text" SELECTED>
to this:
<INPUT NAME="Site_Name" VALUE="Young" Type="text" SELECTED>
no big just have to get rid of the space in the name.

Now we must make the actual mailer, I stole most of this code from the php manual, at php.net. Wwe will call this file makemymail.php, and place it in the same directory as the origional form.
<?php/* recipients */$to  = "your_email@address.here"; /*if you want more then one reciever check the manual at php.net *//* subject */$subject = "An afiliat request from $name";/* message */$message = "$name has requested to become an afiliat of you site, his/her site is $Site_Name";/* additional headers */$headers .= "To: <your_email@address.here>\r\n";$headers .= "From: $name\r\n";/* and now mail it */mail($to, $subject, $message, $headers)?> 

I havn't check the code fully, however it should work fine. If there are any problems with it please post back.

Share this post


Link to post
Share on other sites

Thanks as it turns out I found the php necessary to fix it. I appreciate all of your help and will make sure to remember that. Everything now works fine.

Share this post


Link to post
Share on other sites

Place the following code where you want your form:

form method="get" action="process.php">What is your name?<BR><INPUT NAME="name" VALUE="enter name here" TYPE="text"><P>What is your site name?<BR><INPUT NAME="site_name" VALUE="Young" Type="text" SELECTED><br><INPUT VALUE="Send" TYPE="submit"><INPUT VALUE="Clear This Form" TYPE="reset"></FORM>

Then in a new document called process.php place the following code:

<?php// The error message if there are one or more fields not filled in$error = "There are some fields not filled in, <ahref=\"*YOUR WEBSITE*">Click here to go back</a>";// Let's check if all fields are filled in!if($name == "" || $site_name == "" ){// Lets echo that error!;)echo $error;}/*if after all everything is filled in correct, lets start doing the mailscript...Edit the variable's below to make them fit your needs*/else{$yourwebsite = "*CHANGE*"; // Your website$recipientname = "*CHANGE*"; // Whats your name ?!$subject="*CHANGE*";  // The subject of the mail thats being sended$recipient="*CHANGE*"; // the recipient/*The headers for the e-mail, no need to change it unless you know what you're doing*/$header = "From: $nickname <$email>\r\n";$header .= "MIME-Version: 1.0\r\n";$header .= "Content-Type: text/html; charset=iso-8859-1\r\n";$header .= "X-Priority: 3\r\n";$header .= "X-MSMail-Priority: Normal\r\n";$header .= "X-Mailer: PHP / ".phpversion()."\r\n";/*You can change the text below to whatever you wish to havefor the way the mail is gonne be outputted, you can use HTML!*/$content= "Dear " . $recipientname . "," . $name . " has sent you an e-mail from " . $yourwebsite . ".<br /><b>Message:</b>" . $message . "<hr noshade=\"true\" size=\"1\" color=\"#000000\" />You can contact " . $name . " back at " . $site_name . ".";// Lets send the e-mail by using the mail() function, no need to change below...this // can be edited above!mail($recipient, $subject, $content, $header);// Message the user will see if the e-mail is succesfully sended echo "Thanks! Your comments has been sent succesfully, " . $name . ".";}?>

Place this file in the same place as the above file with the form in it.

TIP: Take a copy of the file above with the form in it, rename it process.php then replace the form code with the above 'process.php' code. This will give the process page the same look and feel of the form page. You can also add any other things as needed.

--
Edited by Dooga (see edit history)

Share this post


Link to post
Share on other sites

Too late, ah well it is now there for anyone else to use and come back on!! ... I remember there being an error with the above code some time back, does any know what it might be looking at the above code??

Share this post


Link to post
Share on other sites

Well I have been very busy trying to get my site up and running and I was trying to make a form for people to fill out to apply to affiliate with my site but when they click submit it opens up a new email instead of sending the form.  This is the code and link.

 

http://forums.xisto.com/no_longer_exists/

 

<form method="get" action="mailto:plenopti@plenopticdesign.be">What is your name?<BR><INPUT NAME="name" VALUE="enter name here" TYPE="text"><P>What is your site name?<BR><INPUT NAME="Site Name" VALUE="Young" Type="text" SELECTED><br><INPUT VALUE="Send" TYPE="submit"><INPUT VALUE="Clear This Form" TYPE="reset"></FORM>

210712[/snapback]


dont use an html code it will not work

i always use ether asp,vb,or php scripting they always work the best

PS:asp script is the best type of script to write mailto forms in

Share this post


Link to post
Share on other sites

I have the HTML with the form and php for the processing page. I got it to work and it is all fine and dandy now. Thanks for all your help.

I remember there being an error with the above code some time back, does any know what it might be looking at the above code??

You are missing the < in the very begining of the code before form. :P I don't know if that was a typo or if it is the problem but if it is that is all it takes to mess it up.

Share this post


Link to post
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...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.