ActiveXperts Mobile Messaging Toolkit Add SMS capabilities to any Windows or .NET application

Quicklinks


Mobile Messaging Toolkit - Pop3 object

Overview

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:

  • Connect to secure POP3 servers (TLS/SSL)
  • Supports plain text and APOP3 authorization
  • POP3 header download
  • Support for multiple attachments
  • Load and save (import and export) MIME (.mim) files

The Pop3 object is part of the ActiveXperts Mobile Messaging Toolkit. Overview of all Mobile Messaging Toolkit objects:

  • Gsm - Send and receive SMS messages using a GSM modem or a modem-capable GSM phone.
  • Smpp - Send and receive SMS messages via an SMPP provider.
  • SmppServer - Accept incoming SMPP connections.
  • Http - Send SMS messages through an HTTP based SMSC provider interface over the internet.
  • Dialup - Send SMS messages using a Hayes compatible modem through TAP/XIO or UCP.
  • Snpp - Send pager messages via an SNPP provider through the internet/VPN.
  • Smtp - Send e-mail messages through SMTP.
  • Pop3 - Receive e-mail messages through POP3.

Sample code

VBScript: Receive e-mail

  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"

More samples

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.