Quicklinks
The Post Office Protocol (POP3) is a standard defined by the Internet Engineering Task Force (IETF) to facilitate electronic mail delivery using TCP/IP. The POP3 server keeps a number of accounts for which is receives e-mail. These e-mail messages are kept until a POP3 client retrieves them from the server.
The Pop3 object features the following:
The Pop3 object is part of the ActiveXperts Mobile Messaging Toolkit. Overview of all Mobile Messaging Toolkit objects:
Set objPop3 = CreateObject("AxMmToolkit.Pop3") ' Create the POP3 protocol object
' Open a connection to the POP3 server
objPop3.SetSecure
objPop3.Connect "pop.gmail.com", "me@gmail.com", "password"
If objPop3.LastError <> 0 Then
WScript.Echo "Error: " & objPop3.GetErrorDescription(objPop3.LastError)
WScript.Quit
End If
' Retrieve all new messages
For i = 1 to objPop3.CountMessages()
Set objMail = objPop3.GetEmailMessage(i)
If objPop3.LastError <> 0 Then
WScript.Echo "Error: " & objPop3.GetErrorDescription(objPop3.LastError)
objPop3.Disconnect
WScript.Quit
End If
WScript.Echo "--------------------------------------------------------------"
WScript.Echo objMail.Date
WScript.Echo objMail.FromAddress
WScript.Echo objMail.Subject
WScript.Echo objMail.BodyPlainText
For j = 1 to objMail.CountAttachments()
strName = objMail.GetAttachmentName(j)
WScript.Echo " Attachment found: " & strName
' Uncomment the following lines to save the attachments.
'strPath = "C:\Temp\" & strName
'WScript.Echo " Saving attachment to : " & strPath
'objMail.SaveAttachment j, strPath
Next
Next
objPop3.Disconnect
WScript.Echo "Disconnected"
Samples are available for: C# .NET, Visual Basic .NET, Visual C/C++, VBA, ASP, ASP .NET, Java, Javascript, PHP, HTML, ColdFusion, Delphi, C++ Builder and more.
On ftp.activexperts-labs.com, you can find many Mobile Messaging Toolkit samples. Samples are also part of the Mobile Messaging Toolkit installation.