Jump to content

  • Log in with Facebook Log in with Twitter Log In with Google      Sign In   
  • Create Account

Subscribe to HRA Now!

 



Are you a Google Analytics enthusiast?

Share and download Custom Google Analytics Reports, dashboards and advanced segments--for FREE! 

 



 

 www.CustomReportSharing.com 

From the folks who brought you High Rankings!


Sponsored Content

 

 
 

Photo
- - - - -

Please Help With Email Form


  • Please log in to reply
12 replies to this topic

#1 novice2

novice2

    HR 2

  • Active Members
  • PipPip
  • 41 posts

Posted 20 January 2005 - 09:23 AM

Hello, everyone,
How do I make a form on my site forwad feedback from my site to my Yahoo email without it making OutLook Express pop up. Currently my form uses this simple method: <FORM METHOD="POST" ACTION="mailto:my email address"> What can I use instead of <FORM METHOD="POST" ACTION="mailto:my email address"> to make the form email directly to my yahoo email account. What's the point of a form if it makes OutLook Express to pop up?

#2 Googlewhacked

Googlewhacked

    Got geek?

  • Active Members
  • PipPipPipPipPip
  • 348 posts
  • Location:Florida: The Plywood State

Posted 20 January 2005 - 09:30 AM

Hey novice2,

This will depend on what kind of host you are using (IIS / Apache) and what scripting languages are made available to you.

If you are on IIS, then you will likely need to use ASP / ASP.net.

If you are on Apache, then you will probably have access to PHP and/or Perl.

For example, if you go to my site, there is a form on the right hand side of the page that I created in PHP which generates an email.

If you can post back with this information, then we can offer more specific options.

Phil

#3 linux_lover

linux_lover

    LiLo

  • Active Members
  • PipPipPipPipPipPip
  • 831 posts
  • Location:York, UK

Posted 20 January 2005 - 09:36 AM

A very quick and dirty bit of php to email:

CODE
     

$email = "someone@somewhere.com";
$to  =  $email;
$subject = "An email subject\n";
$body = "The email message.\n\n";
$headers .= "From: mywebsite <info@mywebsite.co.uk>\r\n";
mail($to, $subject, $body, $headers);


Theres much more advanced scripts out there if you have a quick serach on google.

#4 novice2

novice2

    HR 2

  • Active Members
  • PipPip
  • 41 posts

Posted 20 January 2005 - 09:52 AM

Linux Lover, I don't know how to use the code you gave me. Do I jus paste it into my html page or what? wacko.gif

#5 sherri

sherri

    Perceptum et Invenio

  • Active Members
  • PipPipPip
  • 89 posts
  • Location:Lost in Canada

Posted 20 January 2005 - 10:10 AM

If your webhost supports PHP, here is a simple tutorial on how to set up your site so that the SERVER will send the mail... not the users mail program (Outlook):

http://www.dark-stre.../php/php_3.html

Note you must save the page that processes the email (sendmail.php) with the .php extension, but the page with your form CAN have an htm or html extension.

Basically this will make your html form submit to a php page. Then the php code will form an email and send it.

#6 novice2

novice2

    HR 2

  • Active Members
  • PipPip
  • 41 posts

Posted 20 January 2005 - 10:46 AM

Okay, Thankx eveyone, I found a solution but I need to know how to redirect to a different page imidiately after submit is clicked. Whats html the code for this and where do I have to put it?

#7 sherri

sherri

    Perceptum et Invenio

  • Active Members
  • PipPipPip
  • 89 posts
  • Location:Lost in Canada

Posted 20 January 2005 - 11:02 AM

CODE
<meta http-equiv="refresh" content="6; url=http://www.mydomain.com" />


will redirect to mydomain.com after 6 seconds.

(This should probably be in the [url=http://www.highrankings.com/forum/index.php?showforum=38]Technology and Coding forum[/url])

#8 novice2

novice2

    HR 2

  • Active Members
  • PipPip
  • 41 posts

Posted 20 January 2005 - 11:07 AM

I really need it to redirect after the submit button is clicked not timed.

#9 lyn

lyn

    HR 6

  • Active Members
  • PipPipPipPipPipPip
  • 940 posts
  • Location:London, Ontario

Posted 20 January 2005 - 11:28 AM

After your <form> tag, you need a line that reads:
<input type="hidden" name="redirect" value="http://www.mydomain..../newpage.html">

This is the way I usually set up for a "Thank You" or "More Info" page after a visitor submits an order form, for instance.

L.

#10 lyn

lyn

    HR 6

  • Active Members
  • PipPipPipPipPipPip
  • 940 posts
  • Location:London, Ontario

Posted 20 January 2005 - 11:32 AM

QUOTE(linux_lover @ Jan 20 2005, 10:36 AM)
A very quick and dirty bit of php to email:


Lilo, would this be set up as an external script for the form to call?
I have only ever used formmail.pl (in various iterations!) as a form processor.

L.

#11 Randy

Randy

    Convert Me!

  • Moderator
  • 17,540 posts

Posted 20 January 2005 - 01:07 PM

Jack's PHP formmail has a redirect included after submission and is pretty easy to set up and use. Assuming you have PHP available that is.

#12 linux_lover

linux_lover

    LiLo

  • Active Members
  • PipPipPipPipPipPip
  • 831 posts
  • Location:York, UK

Posted 21 January 2005 - 05:02 AM

Ok...

The way I use it is to embed the code in a function:

CODE
function sendEmail($to, $subject, $body){
$headers .= "From: mywebsite <info@mywebsite.co.uk>\r\n";
mail($to, $subject, $body, $headers);
}

//then call it with
sendEmail ("someone@somewhere.com", "An email subject", "The email essage.");


Now... how to call from another page you say (or it fact the same page), you could either use a form, or a url and pass a var in the query string like so (place this inside your body tags):

CODE
<?  // begin php
function sendEmail($to, $subject, $body){
    $headers .= "From: mywebsite <info@mywebsite.co.uk>\r\n";
    mail($to, $subject, $body, $headers);
}
// if redirect needed - uses javascript change url to whatever
if ($_POST['submit']) {
    $to = $_POST['to'];
    $subject = $_POST['subject'];
    $body = $_POST['body'];
    sendEmail ($to, $subject, $body);
    print ("<script language='javascript'>window.location='thankyou.php'</script>");
}
?>

<form name="emailform" method="post" action="<?=$_SERVER['PHP_SELF']?>">
<table>
<tr><td><h1>Email us</h1></td></tr>
<tr>
<td>To:</td>
<td><input type="text" name="to" value="<?=$to?>" /></td>
</tr>
<tr>
<td>Subject:</td>
<td><input type="text" name="subject" value="<?=$subject?>" /></td>
</tr>
<tr>
<td>Body:</td>
<td><textarea name="body"><?=$body?></textarea></td>
</tr>
<tr><td><input type="submit" name="submit" value="Submit"></td></tr>
</table>
</form>

?>


Quick and dirty script!!!

LiLo

#13 turboscout

turboscout

    HR 2

  • Active Members
  • PipPip
  • 20 posts

Posted 23 January 2005 - 12:01 AM

there are some websites that provide submission of email for you and then redirect to a page of your choice. You may want to search for it instead of using php.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users