欢迎光临
我们一直在努力

w3 upload组件实例应用2

建站超值云服务器,限时71元/月

文件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>

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » w3 upload组件实例应用2
分享到: 更多 (0)