* Include the TCP/IP variable copybook.
       COPY `tcpip.cpy`.
       
      * Program Variables
       1 email_to           PIC X(50) value `address@todomain.com`.
       1 email_from         PIC X(50) value `address@fromdomain.com`.
       1 email_subject      PIC X(60) value `sm.cbl test`.
       1 email_message      PIC X(100) value `test message.`.
       1 email_smtp         PIC X(40) value `yoursmtp.com`.
       1 email_reply_to     PIC X(40) value `yourreply@yourdomain.com`.
       1 email_organization PIC X(50) value `My Organization `.
       1 email_cc           PIC X(50) value `cc@yourdomain.com`.
       1 email_bcc          PIC X(50) value `bcc@yourdomain.com`.
       1 email_attachment.
         5 file1   PIC X(80) value `attach1.txt`.
         5 file1   PIC X(80) value `attach2.xls`.

           SENDMAIL USING email_to
                          email_from
                          email_subject
                          email_message
                          email_smtp
                          email_reply_to
                          email_organization
                          email_cc
                          email_bcc
                          email_attachment. 

           DISPLAY `TCPIP-RETURN-CODES: ` & TCPIP-RETURN-CODES.