Glover logo

Email on DOS Computers

 Index

Home Glovers Contact Form

Pegasus Mail

Pegasus Mail Pmail Features

Pmail Extensions

Populist Delphi (1) Delphi (2) Dos Email

Digital Cameras

Digital images Renumber images Slideshows

Databases

Online Databases Access & ASP Access & PHP Mysql & ASP Mysql & PHP

Setting up and using E-mail on a DOS computer

1. INTRODUCTION

This page describes how to set up an ordinary 80286 or even a 8088 IBM-compatible computer to send and receive email through a dial-up connection to an Internet Services Provider (ISP). Pegasus Mail for DOS is used as the email client. I shall explain a basic arrangement, using a DOS batch (ie a *.BAT) executable file. This starts the processes to dial-up the ISP's network, load a Packet Driver to support the subsequent sending and receiving of character strings to the ISP, launching a program to send and receive email files and finally closes down the link gracefully. There are several ways of setting up a DOS email system, but the method described uses free software throughout and is the only one I have found to be reliable. Other approaches employ BOOTP, but this will not work over PPP connections to ISPs like my own where IP addresses are assigned dynamically. Yet other approaches expect the user to note down the (dynamic) IP address given out by the ISP at the CONNECT stage and enter the data into a file (Wattcp.cfg) by using a text editor. A rather clumsy method.

I am grateful for all sorts of information and suggestions received from others - particularly Dan Komaromi for his excellent web page and to Wayne Buttles and John Lewis who put together the Bobcat package.

1.1. Requirements

The requirements for the system are a reliable PC, preferably a 80286 or 80386 machine with 500kBytes or more of RAM, a hard disk drive with 10MBytes or more spare capacity, a copy of the MSDOS Operating system version 3.1 or later and a modem. In theory, the system could be run from a floppy disk This would be rather crude and it is much easier and faster to use a hard disk with space enough to store received mails. The modem could well be an old Hayes-compatible model running at a maximum transmission rate of 9600 baud (bits per second). In this case, the type of serial port common in older PCs, based on the 8250 UART chip is adequate if slow in operation. It is much better to use a modern V34 or V34+ modem operating at 33,600 bits/sec - or even a V90 model operating at 56,000 bits /sec. These faster modems require a 16550 UART chip to implement the increased amount of buffering these higher transmission rates require.

All the software for dialing, implementing packet drivers, sending and receiving email message files between the PC and the (remote) ISP's network can be obtained as freeware. The software is easily obtained by downloading the files from the Internet sites specified below.

1.2. Assumptions

I shall assume you have installed the modem and that, for ease of explanation, it is configured as a COM4: port: ie, employing IRQ3 and with a base address of 2E8 (hexadecimal). Whichever port (COM2: or other) is used, the IRQ and base address must be ascertained. The MSD diagnostic program supplied with the later DOS versions may be used for the purpose.

There are several methods for making a connection to an ISP's network. Amongst other things, the options available depend on whether your account with the ISP provides you with a fixed IP address or whether your connection has to use SLIP (Serial Line Protocol) or PPP (Point to Point Protocol). The most common arrangement is a PPP connection to the ISP which responds by assigning a different ("Dynamic") IP address at the start of each dial-up/login process. This, the arrangement assumed, is the most complicated, since it requires the Packet Driver's configuration to be adjusted each time you dial-up and logon. This is done through the medium of 3 DOS environment variables automatically set up by the software, as will be described.

2. OBTAINING THE FILES

We shall consider a very basic arrangement which serves to explain some important, but somewhat complex aspects of setting up an e-mail facility. You will need to obtain copies of 6 files which may be downloaded by following the links listed below:-
DOSPPP05.ZIP-- 326KBytes
PMPOP110.ZIP - 97Kbytes
PMAIL331.ZIP -- 814KBytes
NETDIAL.ZIP -- 17Kbytes
TERMIN.COM --- 2Kbytes
EMAIL.BAT --- 3Kbytes
Each of these files should be downloaded to a convenient temporary directory - eg C:\TEMP.

Next, create a directory called C:\PMDOS and a subdirectory, C:\PMDOS\MAIL. (Note, I am being definite here to simplify explanation. If you wish to use another directory name instead of C:\PMDOS, you must substitute it in all future references to C:\PMDOS.)
Copy TERMIN.COM and EMAIL.BAT to the C:\PMDOS directory and unzip DOSPPP05.ZIP and NETDIAL.ZIP into the temporary directory. This generates a large number of files, but those we need are the following, which should be copied into the C:\PMDOS directory:-

Netdial.EXE   ------ 17Kbytes * (The dialling program.)
Netdial.SCR   ------  1Kbyte  * (A script file for dialling your ISP)
EPPPD.EXE     ------ 45Kbytes * (The Packet driver and its loader)
TERMIN.COM    ------  2Kbytes * (Unloads the Packet Driver)
EMAIL.BAT     ------  3Kbytes * (Batch file to run system)

Next, unzip PMPOP110.ZIP and PMAIL331.ZIP into theC:\PMDOS directory. One of the files produced during unzipping is called PDPMPOP.EXE (85Kbytes). This program sends/receives email message files between the PC and the ISP's host machine via the modem/telephone connection and should be renamed as PMPOP.EXE. It is worth reading PMPOP.TXT, which explains how PMPOP works.

2.1. Creating script and other text files needed to run the system

We need to create several text files using an ordinary ASCII editor. These are:-

2.2. Editing EMAIL.BAT

A complete listing of the file, already in C:\PMDOS, is as follows:-
@echo off
:DIAL
rem dial up the ISP
NETDIAL BASE 0x2E8 IRQ 3 115200
rem        :    :          :
rem        :         speed - must be the same here and in the packet driver.
rem        :
rem      comport - must be the same for both the netdial and the packet
rem      driver and hangup lines.
If ERRORLEVEL 1 GOTO END

:PKTDRVR

epppd base 0x2E8 irq 3 pktvec 0x60 115200 asyncmap 0 crtscts

call IP-UP.bat
rem IP-UP.BAT, which is updated in epppd, sets the values 
rem of the DOS environment variables: MYIP, REMIP and NETMASK.
rem Next, copy across the config. statements, eventually needed in WATTCP.CFG
rem for my_ip, netmask and gateway. Initially copy to path.cfg
rem which is "included" in WATTCP.CFG (see 1st line in WATTCP.CFG).
echo my_ip=%MYIP% > path.cfg
echo gateway=%remip% >> path.cfg
echo netmask=%netmask% >> path.cfg
echo Ip address set to %MYIP%
echo gateway is %remip%
echo netmask is %netmask%

:PMPOPS
echo - Send and Receive messages to / from your ISP's SMTP and POP3 host machines.
PMPOP -s -v
PMPOP -g -v

:END

rem  remove the packet driver and hang up the phone
termin 0x60       :
rem    vector should be same as used when loading Packet driver 

netdial BASE 0x2E8 IRQ 3 hangup
rem        :
rem     comport should be the same as 2 other places in batch file

:FINAL
echo End of file
Notes:,P> In this file, the line:- "NETDIAL BASE 0x2E8 IRQ 3 115200" starts the dialler with the parameters for the base address of COM4: with a baud rate of 115200 bits /sec - ie, in this example, as fast a data rate as possible, but see below. If the dial-up fails, control is passed to the END label.

The sequence starting with the line:-
"epppd base 0x2E8 irq 3 pktvec 0x60 115200 asyncmap 0 crtscts"

starts the Packet Driver, loading it at address 60 (hexadecimal)and at the same 115200 bits/sec baud rate. These parameters must be identical to those in the NETDIAL line. The lines following this one cause the DOS Environment variables MYIP, REMIP and NETMASK to be set to values passed down the wire to the Packet Driver from the ISP. Then, lines such as "my-ip=%MYIP%" are inserted into the path.cfg file. It may be necessary to chose a lower modem-computer data rate than 115200 bits/sec - some experimentation is necessary, but this figure should be as high as possible. Also, if the modem, or the port to which it is connected uses a different IRQ / base address to the COM4: standard, then the correct values must be substituted for "0x2F8 IRQ 3" in the appropriate places in the file.

The lines:- PMPOP -s -v and PMPOP -g -v start the PMPOP program firstly to send waiting email messages and then to download messages waiting on the ISP's POP3 server.

The remaining lines:-
"termin 0x60" and "netdial BASE 0x2E8 IRQ 3 hangup"
unload the Packet Driver and hang up the modem, closing the dial-up session.

2.3. Editing WATTCP.CFG

The file: C:\PMDOS\WATTCP.CFG needs to be edited to conform with your ISP's requirements. It is assumed that when you dial up your ISP, your machine is assigned a "Dynamic IP Address" which is different each time you dial in. WATTCP.CFG should look like this:-
include=path.cfg
nameserver=172.126.82.9
nameserver=172.126.82.5
sockdelay=40
domainto=30
mss=512
The first line (include...) should be typed in exactly as shown. The next 2 lines specify the IP addresses of the primary and secondary Domain Name Servers. These are provided by your ISP - possibly only one is required. Copy the last 3 lines as shown.

Save the edited file.

2.4. The PATH.CFG and IP-UP.BAT files

Two empty files with these names need to be created and stored in C:\PMDOS. They are needed as part of the automatic mechanism for updating WATTCP.CFG at each dial-in.
2.5. Creating the NETDIAL.SCR file

Modify the NETDIAL.SCR file as follows:-
send "\r"
recv 1000
send "AT\r"
recv 2000 "OK"
recv 200
send "AT&F&C1&D2L3M1\r" # works for most modems, insert correct number
recv 20000 "OK"    # Wait up to 20 seconds for response from ISP
recv 400           # You may need this line if using an external modem
send "ATDT01234567\r"  # insert ISP's number instead of "1234567"
recv 75000 "ogin:" # this should identify query from ISP for "login:"
send "fred\r"      # Enter your user name
recv 60000 "sword:" # this is how most password queries end 
send "Kilroy\r"    # Enter your password

# remove the following line if not needed by your 
# server (You may need to experiment).

recv 2000 ""   # wait 2 seconds 
Save the file after editing.
2.6. Configuring PMPOP

PMPOP is the program which receives mail messages from your POP3 mailbox on your ISP's machine and sends messages you compose in Pmail onwards to your ISP's SendMail machine. It needs to be configured to recognise the names of these machines and your username and password as described in PMPOP.TXT. The configuration parameters are stored in PMPOP.PRO. To set up, select the C:\PMDOS directory and type:-

PMPOP -c

A dialog box appears which should be filled in like the example below. This assumes your name is "Fred Smith", username "fred", password, "Kilroy", email address "fred@tennis.net" and the names of your ISP's POP3 and SMTP host machines are "mail.tennis.net" and smtpmail.tennis.net" respectively. (You need to substitute the names appropriate for your ISP.) The remaining items should be as displayed below.

 Get mail from  : [mail.tennis.net      ]
 User name      :  fred
 User password  :  
 Store mail in  :  c:\pmdos\mail
 Largest message to download (KB) :  0
 Delete messages once downloaded  :  Y

 SMTP mail host :  smtpmail.tennis.net
 From field     :  "Fred Smith" 
 Search mask    :  C:\pmdos\mail\*.PMX
Note: You may wish to specify "N" for the
"Delete messages once downloaded" item.

Save the configuration. This creates the PMPOP.PRO config. file.

2.7. Configuring PMAIL - PCONFIG

The Pegasus Mail client (PMAIL.EXE) needs to be set up to recognise the correct directories in which to store the outgoing queues of messages (files with a .PMX extension) and messages downloaded by PMPOP from your POP3 mailbox (files with a .CNM extension). The setup program is PCONFIG.EXE.

Type PCONFIG Enter and select the "Configuring Pegasus Mail (DOS)" option. Next, chose "Standalone Configuration" and chose "No" - ie chose to select your own directories. Both the New and Home mailbox should be set to C:\PMDOS\MAIL.

Hit Ctrl-Enter, followed by "Y" to complete.

Next, chose the "Manage User defined gateways option. This brings up a dialog box with the default gateway name of "POP" as follows:-

    Gateway name : [POP             ]
   *New mail path :  C:\PMDOS\MAIL  
     Is ? a program to run? :  N
   *New mail search mask :
   *Outgoing mail path :  C:\PMDOS\MAIL
   *Run for outgoing mail :
   *Filename format :  ~d~d.pmx
    Run to validate address :
   *Reply address format :  fred@tennis.net
    Accepts SMTP addresses? :  Y
    Simple message headers? :  'Glue' headers
   UUEncode attachments? :  N
         Burst messages? :  N    Gateway processes BCC? : N
     Strip gateway name? :  Y
   Force all mail through? :  N

Enter all these details as shown, but insert your correct email address instead of fred@tennis.net. You may need to enter the gateway name "POP" explicitly as shown. When complete, hit Ctrl-Enter, followed by "Y" to complete. When the first dialog box returns, chose the "Edit, saving settings" option. The settings are saved in the PCONFIG.RSC file and when complete, both PMPOP and PMAIL will work together cooperatively.

There is one last step, setting PMAIL's preferences.
2.8. Setting PMAIL's preferences

Start Pegasus Mail by typing PMAIL

. At the first screen, chose the Preferences option. A menu appears. Chose General settings to get a listing like that below and, to start with, enter the details as shown, but substituting your email address instead of fred@tennis.net. The remaining options may be chosen to suit your preferences.

 Personal name:  [Fred Smith                      ]
 Dflt reply-to:   fred@tennis.net
 Require password at startup?         N
 Preserve deleted messages?           Y
 Swap out when calling DOS?           N
 Work directory:
 Address only in browser?             N
 Suppress print dialog?               N
 Automatically open new mail?         N
 Leave read new mail new?             Y
 Encrypt copies of encrypted mail?    N
 Don't prompt to confirm deletion?    N
 Multiple enclosures in messages?     Y

Save the preferences by hitting Ctrl-Enter and chosing "Y".

The system is now set up. Pegasus may now be run to compose email messages and will store them in the outgoing queue as files with a PMX extension in the C:\PMDOS\MAIL directory. When a dial-up connection is made with your ISP, PMPOP will send the all the PMX files (ie, the composed messages). Also, PMPOP will download waiting messages as files with a .CNM extension in the same directory where they can be read using PMAIL's Check for new mail option.

3. RUNNING THE SYSTEM

The complete system operates automatically when you run EMAIL.BAT. After ensuring the modem is connected to the telephone system correctly, type EMAIL and then the Enter key to start dialling, sending out-bound messages, downloading incoming messages, closing down the system when these processes are complete.