DynuPOP3
De Wiki Locaweb
|
O DynuPOP3 é o componente que lista o conteúdo de um email POP3 através de scripts em servidores Windows. Para receber e-mails através de um script no ambiente Locaweb, siga o exemplo abaixo:
<%
REM This code connects to POP3 server, and displays a summary of all emails
Set oPOP3 = Server.CreateObject("Dynu.POP3")
If (oPOP3.Connect("pop.meusite.com.br","email@meusite.com.br", "password")) Then
REM Get statistics for number of new messages and their sizes
oPOP3.GetStatistics
REM Get number of new messages
x = oPOP3.NumberOfMessages
Response.Write "Number of new mail:" & x & "<BR>"
Response.Write "Total size of messages:" & oPOP3.MailboxSize
REM Loop through the messages
If x>0 Then
%><table border="1" bordercolor="#cccccc" cellspacing="0">
<tr><td>From</td><td>Date</td><td>Subject</td><td>Size</td><td>Attachment</td></tr><%
For i = 1 to x
If oPOP3.RetrieveMessage(i) Then
REM Display message details
%>
<tr>
<td><%=Server.HTMLEncode(oPOP3.From)%></td>
<td><%=oPOP3.Date%></td>
<td><%=oPOP3.Subject%></td>
<td><%=oPOP3.Size%></td>
<td><%=oPOP3.NumberOfAttachments%></td>
</tr>
<%
End If
Next
%></table><%
End If
REM Disconnect from POP3 server
oPOP3.Close()
Else
Response.Write "Cannot connect to POP3 server"
End If
Set oPOP3 = nothing
%>
Veja tambémLinks |
|