W3 Upload Component Instance application

Source: Internet
Author: User
Tags mail
File 1-upload.asp
<title> W3 Upload </title>
<body>
Upload with W3 upload component
<form action= "uploadprocess.asp" method= "post" enctype= "Multipart/form-data" >
<input type= "File" Name= "Thefile" ><br>
Choose a name: <input type= "text" name= "name" ><br>
<input type= "Submit" value= "transmit" >
</form>
</body>

File 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
%>
<title> W3 Upload </title>
<body>
<br>
<br>
<center>
finished!
</center>
<br>
<br>
<br>
</body>

File 1-jmailupload.asp
This example shows how to bring a jmail attachment when a user uploads a file to the server
<title>emailform</title>
<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'll answer your
Questions as soon as possible.
<br><br>
Your name <br>
<input type= "text" size= "a" name= "name" ><br>

Your e-mail <br>
Type= "text" size= "<input" name= "email" ><br></font>

Recipient Name <br>
<input type= "text" size= "Name=" "Recipient" ><br></FONT>

Title <br>
<select name= "Subject" size= "1" >
<option value= "Help" >help
<option value= "Tips" >tips
<option value= "Other" >other
</select>
<br>

Content <br>
<textarea name= "Body" cols= "rows=" wrap= "Physical" ></textarea>
<br>

Accessories <br>
<input type= "file" name= "attachment" >
<br>
<br>
<input type= "Submit" value= "Submit" >
</form>
</b></font>
</body>


File 2-jmailuploadprocess.asp

<%
Set upload = Server.CreateObject ("W3. Upload ")
Set JMail = Server.CreateObject ("Jmail.smtpmail") </font >

' Check the attachment and add it to the email
Set attachment = Upload. Form ("Attachment")
If attachment. Isfile Then
Jmail.addcustomattachment Attachment.filename, Attachment.item
End If

' Get form variable, use upload component
Name = Upload. Form ("name")
Senderemail = Upload. Form ("email")
Subject = "regarding" & upload. Form ("Subject")
Recipient = Upload. Form ("Recipient")
BODY = upload. Form ("Body")

' Enter your smtp-server.
jmail.serveraddress = "Xxx.zzz.yyy"

Jmail.sender = Senderemail
Jmail.subject = Subject

Jmail.addrecipient Recipient

Jmail.body = Body

Jmail.priority = 3

Jmail.execute

%>

<title>Dimac</title>

<body>
<br>
<br>
<p align= "center" ><font face= "Arial, Geneva" size= "5" >
Mail Send </font></p>
<center>
<font face= "Arial, Geneva" size= "3" >
Your email was sent to <%= recipient%> <br>
<br>
<br>
<br>

</font>

</center>
</body>


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.