<%
If Request("Remove") <> "" Then
For Each id in Request("ID")
Session("arrFiles").Remove CInt(id)
Next
End If
%>
AspEmail: Editing Attachments
Select a file, then click on "Attach File". When finished, click on "Done".
File uploading is implemented using AspUpload.
Attached Files:
<%
Set arrTo = Session("arrTo")
Set arrCc = Session("arrCC")
Set arrBcc = Session("arrBcc")
Set arrFiles = Session("arrFiles")
' Handle "Send Message" button
Mail.Host = "mail.myisp.com" ' replace it with your own SMTP server address
If Request("SEND") <> "" Then
' get addresses from collections
Items = arrTo.Items
For i = 0 to arrTo.Count - 1
Mail.AddAddress Items(i)
Next
Items = arrCc.Items
For i = 0 to arrCc.Count - 1
Mail.AddCc Items(i)
Next
Items = arrBcc.Items
For i = 0 to arrBcc.Count - 1
Mail.AddBcc Items(i)
Next
Items = arrFiles.Items
For i = 0 to arrFiles.Count - 1
Mail.AddAttachment Items(i)
Next
Mail.From = "info@persits.com"
Mail.FromName = "AspEmail Live Demo"
Mail.Subject = Request("Subject")
Mail.Body = Request("Body")
ErrStr = ""
If Request("Signature") <> "" Then
' Send signed message. Use Persits Software AspEncrypt (www.aspencrypt.com)
Set CM = Server.CreateObject("Persits.CryptoManager")
Set Context = CM.OpenContext( "", True)
Set Msg = Context.CreateMessage
CM.LogonUser "", "Administrator", "xxxxxxxx"
Set Store = CM.OpenStore( "MY", True)
' use your own signer certificate serial number here
Set SignerCert = Store.Certificates("67D1 4E91 A7EF DDA8 490E BC7D 5621 CA1C")
Msg.SetSignerCert SignerCert
On Error Resume Next
Mail.SendSigned Msg
If Err <> 0 Then
ErrStr = Err.Description
Else
arrTo.RemoveAll
arrCc.RemoveAll
arrBcc.RemoveAll
arrFiles.RemoveAll
ErrStr = "success"
End If
On Error Goto 0 ' cancel On Error Resume Next
Else
' send regular (no signature)
On Error Resume Next
if not Mail.Send Then
ErrStr = Err.Description
Else
arrTo.RemoveAll
arrCc.RemoveAll
arrBcc.RemoveAll
arrFiles.RemoveAll
ErrStr = "success"
End If
On Error Goto 0 ' cancel On Error Resume Next
End If ' send signed?
End If
' Handle "Add Address" buttons
Session("Count") = Session("Count") + 1
If Request("Address") <> "" Then arrTo.Add Session("Count"), CStr(Request("Address"))
If Request("CCAddress") <> "" Then arrCc.Add Session("Count"), CStr(Request("CCAddress"))
If Request("BccAddress") <> "" Then arrBcc.Add Session("Count"), CStr(Request("BccAddress"))
' Handle Delete command
If Request("DeleteTo") <> "" Then arrTo.Remove CInt(Request("DeleteTo"))
If Request("DeleteCc") <> "" Then arrCc.Remove CInt(Request("DeleteCc"))
If Request("DeleteBcc") <> "" Then arrBcc.Remove CInt(Request("DeleteBcc"))
%>
Persits Software AspEmail Demo
Welcome to the AspEmail Live Demo. Enter an email address in the To, CC, or BCC box and
press the corresponding "Add Address" button. Click on an address to remove it from the list.
Click "Edit Attachments" to upload file attachments. Then fill in the Subject box and
Message text area. When finished, click "Send Message".
We will NOT sell
or otherwise release
your email address to anyone!
Attachments:
<%
For i = 0 to arrFiles.Count - 1
Keys = arrFiles.Keys
Items = arrFiles.Items
Response.Write Items(i) & "; "
Next
%>
<%
Session("ErrorMsg") = ""
' Use Persits Software AspUpload (www.aspupload.com) to upload attachments
Set Upload = Server.CreateObject("Persits.Upload")
On Error Resume Next
Upload.OverwriteFiles = False
Upload.Save "c:\upload\email" ' Temp directory that stores uploaded files
If Err <> 0 Then
Session("ErrorMsg") = Err.Description
Else
Session("Count") = Session("Count") + 1
Session("arrFiles").Add Session("Count"), CStr(Upload.Files(1).Path)
End If
Response.Redirect "Attachments.asp"
%>
On this site I'll include everything about my favorite TV show, including episode reviews, cast biographies, a photo album
of my favorite pictures from the show, and more.
On this home page, I might include some history and background on the show, such as what network it appears on and when it
first came on the air. I might also include some information about how I became a fan and what I think makes this show so
special.
Please let me know if you share my enthusiasm or enjoy my site!
Here I might put a picture I've taken of a piece of memorabilia inspired by the show, such as a lunchbox or board game.