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

 
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
Page: [1]
 
wizard_oz

 

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

 
email - 4/20/2005 9:58:19   
Hi, I need an example of asp code how to send email with attach file from the web site to the server
Thanks, Elen
wizard_oz

 

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

 
RE: email - 4/20/2005 11:36:19   
I have a code that doesn't work can anyone help me?
<%
	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.Send
		SET myMail=nothing
	end sub
	
	fromWho=TRIM( Request.Form("fromWho"))
	toWho=TRIM( Request.Form("toWho"))
	Subject=TRIM( Request.Form("Subject"))
	Body=TRIM( Request.Form("body"))
	if toWho<>"" then
		sendMail fromWho,toWho,Subject,body
	end if
%>
<FORM method="POST" action="<%=Request.ServerVariables("SCRIPT_NAME")%>">
<br>TO:<INPUT type="text" name="toWho" size=40>
<br>FROM:<INPUT type="text" name="fromWho" size=40>
<br>SUBJECT:<INPUT type="text" name="subject" size=40>
<br><TEXTAREA rows=5 cols=40 id=textarea1 name=body></TEXTAREA>
<BR><INPUT type="submit" value="Send Mail" id=submit1 name=submit1>
</FORM>

(in reply to wizard_oz)
BeTheBall

 

Posts: 6359
Joined: 6/21/2002
From: West Point Utah USA
Status: offline

 
RE: email - 4/20/2005 13:24:22   
I thought you said you needed to include an attachment? The code above has no section for attachments. Do you need to include an attachment or did you misspeak?

_____________________________

Duane

Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.

(in reply to wizard_oz)
Spooky

 

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

 
RE: email - 4/20/2005 15:44:24   
Youll attach like so :
<%
	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 "c:\inetpub\wwwroot\filename.zip"
		myMail.Send
		SET myMail=nothing
	end sub
	
	fromWho=TRIM( Request.Form("fromWho"))
	toWho=TRIM( Request.Form("toWho"))
	Subject=TRIM( Request.Form("Subject"))
	Body=TRIM( Request.Form("body"))
	if toWho<>"" then
		sendMail fromWho,toWho,Subject,body
	end if
%>



_____________________________

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 - 4/21/2005 1:58:27   
This is my first time creating the email application,what should I write in the fromWho? is this the person who look at the web site?
What should I put in toWho? is this me? and if so, what should I put there?
At the above code I tryied to create a form but it doesn't work, can you explain to me why?

(in reply to Spooky)
Spooky

 

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

 
RE: email - 4/21/2005 3:42:10   
The first thing to try - would be to see if the form works.
Use your own email address in moth boxes.

Does the mail arrive or is an error created?

_____________________________

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 - 4/21/2005 4:06:55   
at my code I input my email and I got en error messege in line 4

(in reply to Spooky)
Page:   [1]

All Forums >> Web Development >> ASP and Database >> email
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