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!
More SEO Content
Please Help With Email Form
#1
Posted 20 January 2005 - 09:23 AM
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
Posted 20 January 2005 - 09:30 AM
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
Posted 20 January 2005 - 09:36 AM
$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
Posted 20 January 2005 - 09:52 AM
#5
Posted 20 January 2005 - 10:10 AM
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
Posted 20 January 2005 - 10:46 AM
#7
Posted 20 January 2005 - 11:02 AM
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
Posted 20 January 2005 - 11:07 AM
#9
Posted 20 January 2005 - 11:28 AM
<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
Posted 20 January 2005 - 11:32 AM
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
Posted 20 January 2005 - 01:07 PM
#12
Posted 21 January 2005 - 05:02 AM
The way I use it is to embed the code in a function:
$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):
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
Posted 23 January 2005 - 12:01 AM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users








