Jump to content

Mailto Post


tecra134

Recommended Posts

I'm trying to make a form that a person can fill out. When they click submit, it will send what they wrote to me in a e-mail.This is what I have:

<form action = "MAILTO:E-mail" method = "post" enctype = "text/plain">alkdsjflasjalsdjflasdjfa;lkdfalsdj</form><input type = "submit">

What I dont like that this does, is it opens the microsoft outlook express. I want it to send me the form information without opening outlook express.I would like it to send the form to my e-mail, and also redirect them to a different page.

Link to comment
Share on other sites

This might sound crazy, but I had it working before.(Using just HTML)It wouldn't open outlook express, it would just send it, then redirect to a different page. I lost all the code, and I don't remember how I did it.
Well, that's just not logically possible. HTML does nothing on its own. HTML is not a programming language. It just tells the browser how to display the page.
Link to comment
Share on other sites

Only a server-side language, like PHP, can do it.Maybe something like this:

<?php if($_GET['send'] == "true") {// Code to send mail}?><form action="?send=true" mathod="post"><!-- HTML form -->......</form>

Link to comment
Share on other sites

Are you mixing the Get and POST methods there?
No, not at all, I use a GET variable to indicate that I want to process the form.I use the post variables to send the form data itself.It could also be done with a POST variable, only to do that I'd have to add an<input type="hidden" name="send" value="true">
Link to comment
Share on other sites

I tried what is on w3schools. (The PHP)

<html><body><?phpif (isset($_REQUEST['email']))//if "email" is filled out, send email  {  //send email  $email = $_REQUEST['email'] ;   $subject = $_REQUEST['subject'] ;  $message = $_REQUEST['message'] ;  mail( "someone@example.com", "Subject: $subject",  $message, "From: $email" );  echo "Thank you for using our mail form";  }else//if "email" is not filled out, display the form  {  echo "<form method='post' action='mailform.php'>  Email: <input name='email' type='text' /><br />  Subject: <input name='subject' type='text' /><br />  Message:<br />  <textarea name='message' rows='15' cols='40'>  </textarea><br />  <input type='submit' />  </form>";  }?></body></html>

I replaced my e-mail of course I couldn't get it to work. Do I need to modify anything on this to make it work?

Link to comment
Share on other sites

I tried what is on w3schools. (The PHP)
<html><body><?phpif (isset($_REQUEST['email']))//if "email" is filled out, send email  {  //send email  $email = $_REQUEST['email'] ;   $subject = $_REQUEST['subject'] ;  $message = $_REQUEST['message'] ;  mail( "someone@example.com", "Subject: $subject",  $message, "From: $email" );  echo "Thank you for using our mail form";  }else//if "email" is not filled out, display the form  {  echo "<form method='post' action='mailform.php'>  Email: <input name='email' type='text' /><br />  Subject: <input name='subject' type='text' /><br />  Message:<br />  <textarea name='message' rows='15' cols='40'>  </textarea><br />  <input type='submit' />  </form>";  }?></body></html>

I replaced my e-mail of course I couldn't get it to work. Do I need to modify anything on this to make it work?

Rather than $_REQUEST, try $_POST.And check to see if your file is actually called "mailform.php"
Link to comment
Share on other sites

Also check, of course, that you have the page on a functioning server with PHP installed and that you named the form fields correctly.

Link to comment
Share on other sites

I am using geocities as my web server, they do support PHP.
No they don't. Not their free offers, that's for sure. I don't know about the paid ones.
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...