|
wizard_oz -> email - input text (4/26/2005 9:00:58)
|
Hi, I would like to create a form that the user is fill in all his details like: name, age, company etc How do I do it in my code? .
<%
sub sendMail(fromWho,toWho,subject,body)
dim myMail
SET myMail=server.CreateObject("CDONTS.Newmail")
myMail.From=fromWho
myMail.TO=toWho
myMail.Subject=Subject
myMail.Body=Body
myMail.AttachFile attachf
myMail.Send
SET myMail=nothing
end sub
fromWho=TRIM( Request.Form("fromWho"))
toWho=user@userdomain
Subject=TRIM( Request.Form("Subject"))
Body=TRIM( Request.Form("body"))
attachf=Request.Form("attachf")
if toWho<>"" then
sendMail fromWho,toWho,Subject,body
end if
%>
<body>
<FORM method="POST" action="<%=Request.ServerVariables("SCRIPT_NAME")%>" id=form1 name=form1>
<br>FROM:<INPUT type="text" name="fromWho" size=40>
<br>SUBJECT:<INPUT type="text" name="subject" size=40>
<br><TEXTAREA rows=5 cols=40 name="body"></TEXTAREA>
<br><INPUT type="file" id=file1 name="attachf">
<BR><INPUT type="submit" value="Send Mail" id=submit1 name=submit1>
</FORM>
</body>
|
|
|
|