% @LANGUAGE=VBSCRIPT %>
<%
Set pop3 = Server.CreateObject( "JMail.POP3" )
pop3.Connect "steven@webcaddy.com.au", "charles", "pop.ozhosting.com"
Response.Write( "You have " & pop3.count & " emails in your mailbox!
" )
if pop3.count > 0 then
Set msg = pop3.Messages.item(pop3.count)
' Note the first element of this array is 1
' since the POP3 server starts counting at 1
ReTo = ""
ReCC = ""
Set Recipients = msg.Recipients
separator = ", "
' We now need to get all the recipients,
' both normal and Carbon Copy (CC) recipients
' and store them in a variabel
For i = 0 To Recipients.Count - 1
If i = Recipients.Count - 1 Then
separator = ""
End If
Set re = Recipients.item(i)
If re.ReType = 0 Then
ReTo = ReTo & re.Name & " (" & re.EMail & ")" & separator
else
ReCC = ReTo & re.Name & " (" & re.EMail & ")" & separator
End If
Next
' This function iterates through the Attachments object,
' and saves the attachment to the server's disk.
' It also returns a nicely formatted string with a
' link to the attachment.
Function getAttachments()
Set Attachments = msg.Attachments
separator = ", "
For i = 0 To Attachments.Count - 1
If i = Attachments.Count - 1 Then
separator = ""
End If
Set at = Attachments(i)
'at.SaveToFile( "c:" & at.Name )
getAttachments = getAttachments & "" & at.Name & "(" & at.Size & " bytes)" &_
"" & separator
Next
End Function
%>
| Subject | <%= msg.Subject %> |
| From | <%= msg.FromName %> |
| Recipients To | <%= ReTO %> |
| Recipients CC | <%= ReCC %> |
| Attachments | <%= getAttachments %> |
| Body | <%= msg.Body %> |