navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

Microsoft MVP

 

email - input text

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> email - input text
Page: [1]
 
wizard_oz

 

Posts: 140
Joined: 9/3/2004
From: Ga,USA
Status: offline

 
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>
Spooky

 

Posts: 26603
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: email - input text - 4/26/2005 14:16:47   
Just a question first - you realise the attach method wont work if the file doesnt exist on the server?

 <%

fromWho=TRIM( Request.Form("fromWho"))
toWho=user@userdomain
Subject=TRIM( Request.Form("Subject"))
Body=TRIM( Request.Form("body"))

Company = Request.form("company")

attachf=Request.Form("attachf")
if toWho<>"" then
dim myMail
SET myMail=server.CreateObject("CDONTS.Newmail")

myMail.From=fromWho
myMail.TO=toWho
myMail.Subject=Subject
myMail.Body=Body & vbrlf & "Company="&Company
myMail.AttachFile attachf
myMail.Send
SET myMail=nothing

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>Company:<INPUT type="text" name="Company" 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> 
 



_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to wizard_oz)
wizard_oz

 

Posts: 140
Joined: 9/3/2004
From: Ga,USA
Status: offline

 
RE: email - input text - 4/27/2005 8:27:27   
what do you mean by that? and if it doesn't work, can you help me to get a code that the client fill in the details like name,company,street,etc. and the upload a file from his computer (the file is always a picture)
Thanks, Elen

(in reply to Spooky)
Page:   [1]

All Forums >> Web Development >> ASP and Database >> email - input text
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts