About POP/400

This quick-start guide shows you how to use POP/400.
 
POP/400 uses email APIs to allow applications to retrieve email messages from any POP3 mail box and process the returned messages. POP/400 helps implement applications such as web-form processing, simple order entry, customer-order status inquiry, or any other application that a web form handles. POP/400 lets you retrieve each email message and process it with an RPG or COBOL program. 
 
With POP/400, you can:
  • Retrieve email messages from any POP3 email system.
  • Leave messages on the mail server or delete them after processing.
  • Log an entire POP3 mail session.
  • Store messages in standard iSeries file members.
  • Use RPG or COBOL programs to process messages.
  • Parse message fields and write them to iSeries files.
  • Call an exit program after each message is retrieved.
  • Call an exit program after all messages are retrieved.
  • Have all API calls be CL commands.

Getting Started

  1. Install the POP/400 library (RJSPOP3).
  2. License POP/400.
  3. Access the main menu:

    ADDLIBLE RJSPOP3
    GO RJSPOP3

A POP3 mail retrieval scenario usually consists of the following steps:
  1. Set up a POP3 mailbox on any POP3 server to receive messages. 
  2. Use the POPMON or POPGET commands to periodically retrieve messages to the iSeries. 
  3. Use an RPG or COBOL programto read the retrieved messages and extract data values.
  4. Either delete the message members or retain them for archival purposes. 

Running POP3 Email Retrieval Interactively (POPGET)

 
POPGET (menu option 10) retrieves POP3 email messages interactively or as part of a batch job. The POPMON monitor command also calls POPGET to retrieve messages. 
 
POPGET parameters:
  • Output file to hold messages - The file where each retrieved message is placed as a member. The default is the POPMSG file in the RJSPOP3 library. 
  • POP3 Server IP Address - The POP3 server IP address.

    Note: RJS Software will add DNS support soon, so that you can also enter a host name.  

  • POP3 User - The POP3 mailbox user ID. This parameter is case sensitive. Use single quotes if the user ID contains mixed or lower-case values.
  • POP3 Password - The POP3 password. This parameter is case sensitive. Use single quotes if the password contains mixed or lower-case values. 
  • Download message headers into the POP3 session log:
    • *NO - The usual setting.
    • *YES - Download the header portion of each message and place the header into the message log.
  • Download messages - *YES, enable downloading messages. 
  • Delete messages after download - *YES, empty the POP3 mailbox after messages are retrieved. 
  • Log entire POP3 session:
    • *NO - The usual setting.
    • *YES - Create one large file member created that contains the entire POP3 session for processing.
  • Display POP3 session log file:
    • *NO - The usual setting.
    • *YES - Display the POP3 session log after processing, for debugging. 
  • Print POP3 session log file:
    • *NO - The usual setting.
    • *YES - Print the POP3 session log after processing, for debugging. 
  • Exit program to process msg - The name of the exit program to process each message as it is retrieved.

    Note: You can view a sample exit program POPEXIT1C in the SOURCE source file in the RJSPOP3 library.

  • End of process exit program - The name of the exit program to call after all messages are retrieved.

    Note: You can view a sample exit program POPEXIT2C in the SOURCE source file in the RJSPOP3 library.

Press Enter to retrieve messages from the POP3 mailbox.
 

Displaying POP3 Messages (POPDSP)

 
After downloading email messages, use the POPDSP (menu option 11) command to display the messages.
 
POPDSP parameters:
  • File/Library name - The message file to display. The default is the POPMSG file in the RJSPOP3 library. Each retrieved message is stored in a message file member. 
Press Enter to display the retrieved email messages. 
 

Getting the Current POP3 Message Count (POPCOUNT)

 
Run the POPCOUNT (menu option 12) command in a CL program to retrieve the current number of messages in a POP3 mailbox. This is useful when you only want to retrieve email if messages are found in the mailbox. The POPMON monitor command also uses POPCOUNT.
 
You can only call POPCOUNT from within a CL or RPG program. You can view a sample CL program POPTEST1 in teh SOURCE source file in the RJSPOP3 library.
 
POPCOUNT parameters:
  • POP3 Server IP Address - The POP3 server IP address.

    Note: RJS Software will add DNS support soon, so that you can also enter a host name.  

  • POP3 User - The POP3 mailbox user ID. This parameter is case sensitive. Use single quotes if the user ID contains mixed or lower-case values. 
  • POP3 Password - The POP3 password. This parameter is case sensitive. Use single quotes if the password contains mixed or lower-case values.
  • Return message count - A nine-digit numeric value that will contain the number of retrieved messages.

Running the Automated POP3 Mailbox Monitor (POPMON)

 
POPMON (menu option 13) automatically retrieves POP3 email messages interactively or as part of a batch job. When run in batch, submit POPMON to the QSYSNOMAX job queue so that it runs within the QSYSWRK subsystem and does not impede other iSeries jobs. 
 
POPMON parameters:
  • Delay processing or run once - Whether the monitor will run one time or continuosly until the specified end time. 
  • Delay between cycles - How long the monitor waits between each mailbox check. 
  • Time to end program - When the monitor program ends for the day. To never end the monitor, use 000000
  • Output file to hold messages - The file where each retrieved message is placed as a member. The default is the POPMSG file in the RJSPOP3 library.
  • POP3 Server IP Address - The POP3 server IP address.

    Note: RJS Software will add DNS support soon, so that you can also enter a host name.

  • POP3 User - The POP3 mailbox user ID. This parameter is case sensitive. Use single quotes if the user ID contains mixed or lower-case values. 
  • POP3 Password - The POP3 password. This parameter is case sensitive. Use single quotes if the password contains mixed or lower-case values.
  • Download message headers into the POP3 session log:
    • *NO - The usual setting.
    • *YES - Download the header portion of each message and place the header into the message log.
  • Download messages - *YES, enable downloading messages.
  • Delete messages after download - *YES, empty the POP3 mailbox after messages are retrieved.
  • Log entire POP3 session:
    • *NO - The usual setting.
    • *YES - Create one large file member created that contains the entire POP3 session for processing.
  • Print POP3 session log file:
    • *NO - The usual setting.
    • *YES - Print the POP3 session log after processing, for debugging. 
  • Exit program to process msg - The name of the exit program to process each message as it is retrieved.

    Note: You can view a sample exit program POPEXIT1C in the SOURCE source file in the RJSPOP3 library.

  • End of process exit program - The name of the exit program to call after all messages are retrieved.

    Note: You can view a sample exit program POPEXIT2C in the SOURCE source file in the RJSPOP3 library.

Press Enter to run the POPMON command to retrieve messages or submit to batch with the SBMJOB command. 

 

Troubleshooting POP/400

  • 20. Ping Remote POP3 Server - PING the remote POP3 server. 
  • 21. Connect to POP3 Server via Telnet - Connect to the POP3 server to see if the POP3 service is running on TCP/IP port 110. 
  • 22. AS/400 TCP/IP Configuration Menu - Display the AS/400 TCP/IP configuration menu.

Still have questions? We can help. Submit a case to Technical Support.

Last Modified On: December 10, 2016