Your program can merely generate text files with messages and put them in MAIL\OUT directory, so that Advanced Direct Remailer send them. Messages format is the following:
>>> you@yourisp.com
<<< recipient@recipient.com
From: "You" <you@yourisp.com>
To: <recipient@recipient.com>
Subject: TEST!
Dear Recipient, it is test !
.
The first line contains sender's address, the second line contains recipient's address. An empty line is followed by the message thread ending with full stop and CRLF. It is recommended to view outgoing messages in MAIL\OUT directory to learn what else fields mail programs add to a message heading and find out more details about messages format.
After your program has generated the message, you need ADR to reread the OUT directory to add the messages into the outgoing queue. ADR doesn't do this constantly, as scanning the directory might take tens of seconds and result in heavy loading of the system due to intense work with the disk. There are three possible ways to scan the directory:
1.To relaunch ADR
2.To run the program Utils\Sync\Sync.exe
3.To send a message to the ADR window.
When the ADR window receives the message WM_USER+5, OUT directory is rescanned. Sync.exe ensures rescanning of OUT directory by sending the same message. You can view its text in the file Utils\Sync\Sync.c, it contains just a few lines.
If ADR is configured so that mail sending can be started only manually, you also can send the message WM_USER+6 to the ADR window to have ADR started sending mail, or to run the program Utils\Mailing\Mailing.exe, its source code is also contained in that directory. WM_USER+7 and WM_USER+8 messages cause pause and stop delivery. This functionality is implemented in Pauze.exe and Stop.exe, this programs and their codes are placed into Utils directory. Any your suggestions to develop Advanced Direct Remailer API are welcomed.