Jul 20, 2008

Mailto Error

Free Web Hosting, No Ads > CONTRIBUTE > Computers > Programming Languages > HTML, XML etc..

free web hosting

Mailto Error

Plenoptic
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://plenopticdesign.be/index.php?id=affiliates

CODE
<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>

Reply

tuddy
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.

Reply

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

Reply

moldboy
Try this.

in your code you must change a few things
change this:
CODE
<form method="get" action="mailto:plenopti@plenopticdesign.be">

to this:
CODE
<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:
CODE

<INPUT NAME="Site Name" VALUE="Young" Type="text" SELECTED>

to this:
CODE
<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.
CODE

<?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.

 

 

 


Reply

Plenoptic
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.

Reply

tuddy
Place the following code where you want your form:

CODE
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:

CODE
<?php
// The error message if there are one or more fields not filled in
$error = "There are some fields not filled in, <a

href=\"*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 have
for 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.

--

Reply

tuddy
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??

Reply

CrazyRob
QUOTE(Plenoptic @ Dec 4 2005, 02:14 AM)
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://plenopticdesign.be/index.php?id=affiliates

CODE
<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>

*



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

Reply

Plenoptic
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.

QUOTE
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. smile.gif 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.

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Similar Topics

Keywords : mailto error

  1. Help With Nav Menu Error - (5)
  2. Error In Css (or Html) - (5)
    Well i am currently working on a project, and for this i need to fix this little error: Code is:
    CODE $this->frm .= "<style type=\"text/css\">
                            <!--                         .style1 {color: #000000}
                            -->                         </style>{$this->top}
                            <from action=\"$PHP_SELF\"
    method=\"post\" name=\"\">
                            <table width=\"800�...



Looking for mailto, error

Searching Video's for mailto, error
advertisement



Mailto Error



 

 

 

 

ADD REPLY / Got an Opinion! Remove these ADs! RAPID SEARCH! Free Web Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE