hello. just a newbie here, also in ASP and PHP. i just wanna ask how to send the data gathered from forms to emails? i know that this could be done in php. but i dont know how to do it either.
Here is a php script that will send any form information to an e-mail address I find it pretty handy. if ($_SERVER['REQUEST_METHOD'] != "POST"){exit;} $message = ""; while(list($key,$value) = each($_POST)){if(!(empty($value))){$set=1;}$message = $message . "$key: $value\n\n";} if($set!==1){header("location: $_SERVER[HTTP_REFERER]");exit;} $message = stripslashes($message); $to = "yourmail@yourdomain.com"; $subject = "Your Subject"; if (mail($to, $subject, $message)) { echo("<h1>Thank You</h1>"); } Code (markup):
Couldn`t send attachment via PM so heres a link to the script for asp email and a sample form....http://www.webdesignassociates.net/Forum/index.php?topic=3.msg3#msg3
thanks a lot for the kind hearted responses btw, corey, what about the processor? im just a newbie on asp programming can you please explain the processor thing? Thanks
Your host will support different types of DLLs that send email. Windows NT - 2000 support CDONTS by default, Windows 2000 and 2003 support CDOSYS by default. Many providers support CDONTS on 2003 as well as other objects such as ASPEmail, Jmail and others. Some people don't like CDOSYS because they think MS reads the emails that are sent using it, I like Jmail my self. Mark
Thanks....but have another question... How do we email multiple fields using PHP? For example, in here mail($to, $subject, $message), you are only allowed one variable: $message. What if your form contains, say, 4 variables that need to be emailed.
I see, so you assign the needed variables to $message. Where did you derive .$var1. from? In other words, how do I pass the variables from the original form (POST) to the $message variable? Thanks for the help! Tinkered and figured it out...though, I need to find out how .$variable. work! In due time, in due time...thanks again!