home *** CD-ROM | disk | FTP | other *** search
- <OBJECT RUNAT=SERVER PROGID="Persits.MailSender" ID="Mail">
- </OBJECT>
-
- <%
- Set arrTo = Session("arrTo")
- Set arrCc = Session("arrCC")
- Set arrBcc = Session("arrBcc")
- Set arrFiles = Session("arrFiles")
-
- ' Handle "Send Message" button
- Mail.Host = "smtp.yourcompany.com"
- 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 = "jsmith@persits.com"
- Mail.FromName = "John Smith"
- Mail.Subject = Request("Subject")
- Mail.Body = Request("Body")
- On Error Resume Next
- if not Mail.Send Then
- ErrStr = Err.Description
- Else
- arrTo.RemoveAll
- arrCc.RemoveAll
- arrBcc.RemoveAll
- arrFiles.RemoveAll
- End If
- On Error Goto 0
- 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"))
-
- %>
-
- <HTML>
- <HEAD>
- <META NAME="GENERATOR" Content="Microsoft Developer Studio">
- <META HTTP-EQUIV="Content-Type" content="text/html; charset=iso-8859-1">
- <TITLE>Persits Software AspEmail Demo</TITLE>
- </HEAD>
- <BODY BGCOLOR="#FFFFFF">
- <BASEFONT FACE="Arial, Helvetica">
-
-
- <TABLE WIDTH="80%" BGCOLOR="#C0C0C0" BORDER=2 CELLPADDING=0 CELLSPACING=3>
- <TD>
-
- <TABLE WIDTH="100%" BGCOLOR="#C0C0C0" BORDER=0 CELLPADDING=2 CELLSPACING=0>
- <TR><TH WxIDTH="10"></TH><TH WxIDTH="85%"></TH><TH WIxDTH="10%"></TH></TR>
- <FORM METHOD=GET ACTION="SendMail.asp">
- <TR>
- <TD BGCOLOR="#808080" ALIGN=RIGHT><FONT COLOR="#FFFFFF">To:</FONT></TD>
- <TD BGCOLOR="#E0E0E0">
- <%
- For i = 0 to arrTo.Count - 1
- Keys = arrTo.Keys
- Items = arrTo.Items
- Response.Write "<A HREF=""SendMail.asp?DeleteTo=" & Keys(i) & """>" & Items(i) & "</A>; "
- Next
- %>
- </TD>
- <TD BGCOLOR="#E0E0E0"ALIGN=RIGHT><INPUT TYPE=TEXT NAME="Address"><INPUT TYPE=SUBMIT VALUE="Add Address"></TD>
- </TR>
- <TR>
- <TD BGCOLOR="#808080" ALIGN=RIGHT><FONT COLOR="#FFFFFF">Cc:</FONT></TD>
- <TD>
- <%
- For i = 0 to arrCC.Count - 1
- Keys = arrCC.Keys
- Items = arrCC.Items
- Response.Write "<A HREF=""SendMail.asp?DeleteCc=" & Keys(i) & """>" & Items(i) & "</A>; "
- Next
- %>
- </TD>
- <TD ALIGN=RIGHT><INPUT TYPE=TEXT NAME="CCAddress"><INPUT TYPE=SUBMIT VALUE="Add Address"></TD>
- </TR>
- <TR>
- <TD BGCOLOR="#808080" ALIGN=RIGHT><FONT COLOR="#FFFFFF">Bcc:</FONT></TD>
- <TD BGCOLOR="#E0E0E0">
- <%
- For i = 0 to arrBcc.Count - 1
- Keys = arrBcc.Keys
- Items = arrBcc.Items
- Response.Write "<A HREF=""SendMail.asp?DeleteBcc=" & Keys(i) & """>" & Items(i) & "</A>; "
- Next
- %>
- </TD>
- <TD BGCOLOR="#E0E0E0" ALIGN=RIGHT><INPUT TYPE=TEXT NAME="BCCAddress"><INPUT TYPE=SUBMIT VALUE="Add Address"></TD>
- </TR>
- </FORM>
- <TR>
- <TD BGCOLOR="#808080" ALIGN=RIGHT><FONT COLOR="#FFFFFF">Attachments:</FONT></TD>
- <TD>
- <%
- For i = 0 to arrFiles.Count - 1
- Keys = arrFiles.Keys
- Items = arrFiles.Items
- Response.Write Items(i) & "; "
- Next
- %>
- </TD>
- <TD ALIGN=RIGHT><A HREF="Attachments.asp">Edit Attachments</A></TD>
- </TR>
-
- <FORM METHOD=POST ACTION="SendMail.asp">
- <TR>
- <TD BGCOLOR="#808080" ALIGN=RIGHT><FONT COLOR="#FFFFFF">Subject:</FONT></TD><TD BGCOLOR="#E0E0E0"><INPUT TYPE=TEXT SIZE=40 NAME="Subject"></TD><TD ALIGN=RIGHT BGCOLOR="#E0E0E0"> </TD>
- </TR>
- <TR>
- <TD ALIGN=LEFT BGCOLOR="#C0C0C0" COLSPAN=3><TEXTAREA NAME="Body" COLS=90 ROWS=20></TEXTAREA></TD>
- </TR>
- <TR>
- <TD BGCOLOR="#C0C0C0"><INPUT TYPE=SUBMIT NAME="SEND" VALUE="Send Message"></TD>
- <TD BGCOLOR="#C0C0C0" COLSPAN=2>
- <% If ErrStr <> "" Then %>
- <FONT COLOR="#FF0000"><B>Message was not sent due to the following error: <i><% = ErrStr %></I></B></FONT>
- <% End If %>
- </TD>
- </TR>
- </FORM>
- </TABLE>
-
- </TD>
-
- </TABLE>
- </BASEFONT>
- </BODY>
- </HTML>
-