Examples of Using the API Routines

Several example programs, written in C and C++, are included in the Sun Internet Mail SDK documentation in order to give programmers an easier head start. The following table introduces these examples and provides links to the source code.


TABLE 1 Code Examples
Source code
Program Description

enqueue_a_message.c

Simple program to enqueue a message containing a default body, by specifying the recipient and the originator.

dequeue_messages.c

Simple program which dequeues queued message from a specified channel, and prints information about them.

return_messages.c

Program which returns all queued message from a specified channel, to their originator

reenqueue_messages.c

Program to read messages from the specified channel's queue and then reenqueue them after having transformed their content.

decode_mime_message.c

Programs which decodes multi-part MIME messages

parse_addresses.c

Decomposes an RFC 822 address according to some of its properties (address, local-part, domain-part, phrase) using the RFC 822 Address Parsing API.

create_header.c

Interactive utility to test header manipulation with the Message Header API.

print_counters.c

Displays the channel counters for the specified channel.


Compiling and Linking Programs

An example Makefile is provided in the source directory, along with the code examples.

multi-threaded programs

The Sun Internet Mail SDK library is reentrant and thread-safe.

However, multi-threaded programs are required to use POSIX threads as opposed to Solaris threads.




Copyright © 1999 Sun Microsystems, Inc. All Rights Reserved.