We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
Help with formmail script
Topic Started: Mar 9 2005, 09:56 AM (314 Views)
tiGz
Member
[ *  * ]
Code:
 
<?php
$goto_after_mail = "thanks.htm";
//ver 1.10 added some headers, incl. Mime mail to be accepted by more mail servers
$from_mail = $_REQUEST['from_email'];
$from_name = $_REQUEST['from_name']; // use both value's on you form
$header = "From: \"$from_name\" <$from_mail>\r\n";
$header .= "MIME-Version: 1.0\r\n";
$header .= "Mailer: Olaf's formmail version 1.10\r\n";
$header .= "Content-Type: text/plain; charset=\"iso-8859-1\"\r\n";
$header .= "Content-Transfer-Encoding: 8bit\r\n";
$subject = "your webform posted at".date("d-m-Y"); //your mailsubject incl. current date
foreach ($_REQUEST as $key => $val) {
   if ($key != "from_email" && $key != "from_name") { //skip, this values are already in the header
       $body .= $key . " : " . $val . "\r\n";
   }
}
mail("you@yourmail.com", $subject, $body, $header);
header("Location: ".$goto_after_mail);
?>


There's the code i'm using. Why doesn't it work?
When tested, i click submit and it takes the user to the "Compose Email" screen.
ThankYou
Offline Profile Quote Post Goto Top
 
Jory
Member Avatar
Member
[ *  *  *  *  *  * ]
you mean the compose new message screen from outlook/outlook expres/whatevermailprogyouuse?

if it does that: i have no idea why.


and about the thanks.htm:
personaly, i would just do that on this page.
(now, you are sending them to this page, just to send them somewhere else next.)

and is
Code:
 
header("Location: ".$goto_after_mail);
a working code anyway?
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Technology Chat · Next Topic »
Add Reply