文件1 - Upload.asp
<html>
<head>
<title> w3 Upload </title>
</head>
<body>
用w3 upload组件上传
<input type="file" name="thefile"><br>
Choose a name: <input type="text" name="name"><br>
<input type="submit" value="Transmit">
</form>
</body>
</html>
文件2 - UploadProcess.asp
<% @ LANGUAGE="VBSCRIPT" %>
<%
Set upload = Server.CreateObject( "w3.upload" )
actualName = upload.Form( "name" )
Set fileName = upload.Form( "thefile" )
if fileName.IsFile then
fileName.SaveToFile( Request.ServerVariables( "APPL_PHYSICAL_PATH" ) & "\" & actualName )
end if
%>
<html>
<head>
<title> w3 Upload </title>
</head>
<body>
<br>
<br>
<center>
Finished!
</center>
<br>
<br>
<br>
</body>
</html>
文件1 - JmailUpload.asp
这个例子展示了在用户上传文件给SERVER时如何带JMAIL的附件
<html>
<head>
<title>emailform</title>
</head>
<body>
<font face="verdana, arial" size="2"><b>
<form method="post" action="JmailUploadProcess.asp" ENCTYPE="multipart/form-data">
Complete this form and click the submit-button. We will answer your
questions as soon as possible.
<br><br>
你的名字 <br>
<input type="text" size="25" name="name"><br>
你的邮箱 <br>
<input type="text" size= "25" name= "email"><br>< /FONT>
收信者名字 <br>
<input type= "text" size= "25" name= "recipient"><br>< /FONT>
标题 <br>
<select name="subject" size="1">
<option value="help">help
<option value="tips">tips
<option value="other">other
</select>
<br>
内容 <br>
<textarea name="body" cols="40" rows="15" wrap="PHYSICAL"></textarea>
<br>
附件 <br>
<input type="file" name="attachment">
<br>
<br>
<input type="submit" value=" Submit ">
</form>
</b></font>
</body>
</html>
文件2 - JmailUploadProcess.asp
<%
Set upload = Server.CreateObject( "w3.Upload" )
Set JMail = Server.CreateObject("JMail.SMTPMail")< /FONT >
'检查附件并加入到email中
set attachment = upload.Form( "attachment" )
if attachment.IsFile then
JMail.AddCustomAttachment attachment.filename, attachment.item
end if
'得到form变量,使用upload组件
Name = upload.Form("name")
SenderEmail = upload.Form("email")
Subject = "Regarding " & upload.Form("subject")
Recipient = upload.Form("recipient")
Body = upload.Form("body")
'输入你的SMTP-server
JMail.ServerAddress = "xxx.zzz.yyy"
JMail.Sender = Senderemail
JMail.Subject = Subject
JMail.AddRecipient Recipient
JMail.Body = Body
JMail.Priority = 3
JMail.Execute
%>
<html>
<head>
<title>Dimac</title>
</head>
<body>
<br>
<br>
<p align="center"><font face="Arial, geneva" size="5">
邮件发送 </font></p>
<center>
<font face="Arial, geneva" size="3">
你的邮件被发送到<%= Recipient %> <br>
<br>
<br>
<br>
</font>
</center>
</body>
</html>
通告:http://www.qqread.com/aspdotnet/p992927000.html进入讨论组讨论。
相关图文阅读
频道图文推荐
健 康 咨 询
时 尚 咨 询
相关专题
- asp.net动态设置WebService引用 (22次浏览)
- 安全接口 interface --显示实现接口 (16次浏览)
- .net程序员的盲点(一):ref,out ,params的区别 (11次浏览)
- .net程序员的盲点(二):两个“属性”引起的歧义 (9次浏览)
- .net Framework 2.0下发送邮件的方式 (8次浏览)
- .NET开发人员犯的6大安全错误 (6次浏览)
- 使用正则表达式Replace (5次浏览)
- ASP.NET WebForm Best Practice 之ViewState (5次浏览)
- ASP.NET里的支架:Dynamic Data Support (4次浏览)
- 请跟我来--使用Ext搞个原型 (1次浏览)



