



                         SMTP/POP3 Email Engine

                        Library for Power Basic

                                 (SEE4PB)


                            REFERENCE MANUAL



                               Version 2.1

                            December 9, 1998




                     This software is provided as-is.
              There are no warranties, expressed or implied.




                           Copyright (C) 1998
                           All rights reserved



                       MarshallSoft Computing, Inc.
                           Post Office Box 4543
                           Huntsville AL 35815


                           Voice : 256-881-4630
                             FAX : 256-880-0925
                           email : info@marshallsoft.com
                             web : www.marshallsoft.com

                               _______
                          ____|__     |                (R)
                       --+       |    +-------------------
                         |   ____|__  |  Association of
                         |  |       |_|  Shareware
                         |__|   o   |    Professionals
                       --+--+   |   +---------------------
                            |___|___|    MEMBER


      MARSHALLSOFT is a registered trademark of MarshallSoft Computing.





     SEE4PB Reference Manual                                   Page 1

                            C O N T E N T S



        Chapter                                     Page

        Table of Contents.............................2

        General Remarks...............................3

        SEE Functions.................................3

           seeClose...................................3

           seeDebug...................................4

           seeDecodeBuffer............................5

           seeDeleteEmail.............................6

           seeDriver..................................7

           seeEncodeBuffer............................8

           seeErrorText...............................9

           seeExtractText............................10

           seeGetEmailCount..........................11

           seeGetEmailFile...........................12

           seeGetEmailLines..........................13

           seeGetEmailSize...........................14

           seeIntegerParam...........................15

           seePop3Connect............................17

           seeSendEmail..............................18

           seeSmtpConnect............................19

           seeStatistics.............................20

           seeStringParam............................21

           seeVerifyFormat...........................22

           seeVerifyUser.............................23







     SEE4PB Reference Manual                                   Page 2

      General Remarks

      All functions return an integer code. Negative values are always
      errors. See Section 10.3 "SEE Error Return Code List" in the
      SEE/POP3 Users Manual (SEE4PB_U.TXT). Non-negative return codes are
      never errors.

      Note that all integer variables in Win32 are declared as LONG rather
      than INTEGER. This is because INTEGERS use 2 bytes in Power Basic,
      rather than 4 bytes used in Win32 C/C++ compilers.


      SEE Functions


      +----------+--------------------------------------------------------+
      | seeClose | Closes SMTP/POP3 Email Engine.                         |
      +----------+--------------------------------------------------------+


        SYNTAX  Declare Function seeClose() As Long

       REMARKS  The seeClose function closes the connection created by
                calling seeSmtpConnect or seePop3Connect. seeSmtpConnect or
                seePop3Connect can be called again to open a connection to
                another SMTP or POP3 server if desired.

                SEE can not be connected to both the SMTP server and the
                POP3 server at the same time. Call seeClose to terminate
                one connection before connecting again.

       RETURNS  < 0 : An error has occurred. See the error list.

       EXAMPLE

                ' connect to SMTP server
                Code = seeSmtpConnect(...)
                ' send email with seeSendEmail
                . . .
                ' close connection to SMTP server
                Code = seeClose()
                ' connect to POP3 server
                Code = seePop3Connect(...)
                ' check/read/delete our email as needed
                . . .
                ' close connection to POP3 server
                Code = seeClose()


      ALSO SEE  seeSmtpConnect and seePop3Connect.








     SEE4PB Reference Manual                                   Page 3


      +----------+--------------------------------------------------------+
      | seeDebug | Returns debug information.                             |
      +----------+--------------------------------------------------------+


        SYNTAX  Declare Function seeDebug(
                     ByVal Index As Long,    ' Command index.
                     ByVal Buffer As Asciiz, ' Buffer to place text into.
                     ByVal BufLen As Long)   ' Length of above Buffer.
                  As Long

       REMARKS  The seeDebug function returns debug information depending
                on the value of Index.

                      SEE_GET_REGISTRATION : Gets the registration string.
                     SEE_GET_LAST_RESPONSE : Gets last server response.
                         SEE_GET_SERVER_IP : Gets server IP address in
                                             "dotted" notation.

       RETURNS Length of text placed into 'Buffer'.

       EXAMPLE

                ' Get the registration string from SEE16.DLL or SEE32.DLL.

                Dim Buffer As Asciiz * 128

                Code = seeDebug(SET_GET_REGISTRATION, Buffer, 128)
                Print "Registration: "; Buffer

                ' Also see the SEEVER example program.

      ALSO SEE  seeStatistics.
























     SEE4PB Reference Manual                                   Page 4


      +-----------------+-------------------------------------------------+
      | seeDecodeBuffer | Decodes buffer using BASE64.                    |
      +-----------------+-------------------------------------------------+


        SYNTAX  Declare Function seeDecodeBuffer(
                     Coded As Asciiz,      ' Buffer of BASE64 coded chars.
                     Clear As Asciiz,      ' Buffer to put decoded bytes.
                     ByVal Length As Long) ' Length of 'Coded' buffer.
                  As Long

       REMARKS  The seeDecodeBuffer function decodes the buffer 'Coded'
                of length 'Length' into 'Clear', returning the length in
                'Clear'.

                The buffer 'Coded' MUST contain BASE64 encoded text, as
                created by seeEncodeBuffer.

                The buffer 'Clear' will contain the ASCII or binary data
                that was encoded.

       RETURNS  Number of bytes placed in 'Clear'.

       EXAMPLE

                Dim ClearBuffOne As Asciiz * 100
                Dim ClearBuffTwo As Asciiz * 100
                Dim CodedBuff As Asciiz * 134
                Dim NL As String
                Dim Length As Long

                NL = Chr$(13) + Chr$(10)

                ClearBuffOne = "SEE/POP3 Test" + NL + "Bye." + NL + Chr$(0)

                Length = Len(ClearBuffOne)

                ' BASE64 encode

                Length = seeEncodeBuffer(ClearBuffOne, CodedBuff, Length)

                ' BASE64 decode

                Length = seeDecodeBuffer(CodedBuff, ClearBuffTwo, Length)

                ' ClearBuffTwo should have same text as ClearBuffOne

      ALSO SEE  seeEncodeBuffer.









     SEE4PB Reference Manual                                   Page 5


      +----------------+--------------------------------------------------+
      | seeDeleteEmail | Deletes email from Server.                       |
      +----------------+--------------------------------------------------+


        SYNTAX  Declare Function seeDeleteEmail(
                    ByVal MsgNbr As Long)  ' message number
                  As Long

       REMARKS  The seeDeleteEmail function deletes the email numbered
                'MsgNbr' from the server.

                After each email deletion by the POP3 server, all messages
                are renumbered, the first message being 1. Therefore,
                delete messages from highest to lowest to avoid having to
                recalculate message numbering.

                For example, to delete messages 5, 6, and 7, message 7 is
                deleted first, then message 6, and lastly message 5.

                Be careful! Once an email has been deleted from the
                server, it cannot be recovered.

       RETURNS  < 0 : An error has occurred. See the error list.

       EXAMPLE

                Dim Code As Long
                . . .
                ' delete message # 5 , # 6, and #7.
                Code = seeDeleteEmail(7)
                IF Code >= 0 THEN
                   Code = seeDeleteEmail(6)
                END IF
                IF Code >= 0 THEN
                   Code = seeDeleteEmail(5)
                END IF
                . . .

      ALSO SEE  seeGetEmailCount.

















     SEE4PB Reference Manual                                   Page 6


      +-----------+-------------------------------------------------------+
      | seeDriver | Executes next SEE state.                              |
      +-----------+-------------------------------------------------------+


        SYNTAX  Declare Function seeDriver() As Long

       REMARKS  The seeDriver function executes the next state in the SEE
                state engine. The purpose of this function is to allow the
                programmer to get control after the driver executes each
                SEE state.

                The seeDriver function is explicitly called only after the
                AUTO_DRIVER_CALL flag has been disabled (see function
                seeIntegerParam). If the AUTO_DRIVER_CALL flag has not been
                disabled (the default), then seeDriver does not need to be
                called.

                Refer to the section 4.0 "Theory of Operation" in the
                SMTP/POP3 Users Manual for more details on the operation of
                seeDriver.

       RETURNS  = 0 : The driver is done.
                < 0 : An error has occurred. See the error list.
                > 0 : The returned value is the state just executed.

       EXAMPLE

                Dim Code As Long
                . . .
                Code = seeSmtpConnect(...)
                . . .
                ' disable automatic calling of seeDriver().
                Code = seeIntegerParam(AUTO_DRIVER_CALL,  0)
                Code = seeSendEmail(...)
                IF Code< 0 THEN
                  PRINT "Error " + Str$(Code)
                  EXIT SUB
                END IF
                DO
                  Code = seeDriver()
                  IF Code < 0 THEN
                    PRINT "Error " + Str$(Code)
                    EXIT SUB
                  END IF
                  IF Code = 0 THEN
                    EXIT SUB
                  END IF
                  ' do something here . . .
                LOOP

      ALSO SEE  seeIntegerParam, seeSmtpConnect, and seePop3Connect.





     SEE4PB Reference Manual                                   Page 7


      +-----------------+-------------------------------------------------+
      | seeEncodeBuffer | Encodes buffer using BASE64.                    |
      +-----------------+-------------------------------------------------+


        SYNTAX  Declare Function seeEncodeBuffer(
                     Clear As Asciiz,      ' Buffer to put decoded bytes.
                     Coded As Asciiz,      ' Buffer to put BASE64 encoded.
                     ByVal Length As Long) ' Length of 'Clear' buffer.
                  As Long

       REMARKS  The seeEncodeBuffer function encodes 'Clear' into
                'Coded' using Base-64 encoding.

                The 'Clear' buffer may contain any ASCII or binary data.

                The 'Coded' buffer will contain 7-bit ASCII data broken
                into lines of 76 characters followed by a carriage return
                Chr$(13) and line feed Chr$(10). That is, 'Coded' will
                contains multiple lines.

       RETURNS  Number of bytes in 'Coded'.

       EXAMPLE

                Dim ClearBuffOne As Asciiz * 100
                Dim ClearBuffTwo As Asciiz * 100
                Dim CodedBuff As Asciiz * 134
                Dim NL As String
                Dim Length As Long

                NL = Chr$(13) + Chr$(10)

                ClearBuffOne = "SEE/POP3 Test" + NL + "Bye." + NL + Chr$(0)

                Length = Len(ClearBuffOne)

                ' BASE64 encode

                Length = seeEncodeBuff(ClearBuffOne, CodedBuff, Length)

                ' BASE64 decode

                Length = seeDecodeBuff(CodedBuff, ClearBuffTwo, Length)

                ' ClearBuffTwo should have same text as ClearBuffOne

      ALSO SEE  seeIntegerParam, seeSmtpConnect, and seePop3Connect.









     SEE4PB Reference Manual                                   Page 8


      +--------------+----------------------------------------------------+
      | seeErrorText | Get text associated with error code.               |
      +--------------+----------------------------------------------------+


        SYNTAX  Function seeErrorText(
                    ByVal Code As Long,      ' Error code returned by SEE.
                    Buffer As Asciiz,        ' Buffer to place error text.
                    ByVal BufLen As Long)    ' Length of above Buffer.

       REMARKS  The seeErrorText function is used to get the error text
                associated with an an error code as returned by one of the
                other SEE functions.

                When an error occurs, seeErrorText can be used to get the
                error text so that it can be displayed for the user.

       EXAMPLE

                Dim Buffer As Asciiz * 64
                Dim Code As Long

                Code = seeSmtpConnect(...)
                IF Code < 0 THEN
                   ' error detected
                   Code = seeErrorText(Code, Buffer, 64)
                   PRINT Buffer
                END IF

      ALSO SEE



























     SEE4PB Reference Manual                                   Page 9


      +----------------+--------------------------------------------------+
      | seeExtractText | Extract specified text from buffer.              |
      +----------------+--------------------------------------------------+


        SYNTAX  Declare Function seeExtractText(
                    Source As Asciiz,       ' Text buffer to search.
                    Text   As Asciiz,       ' Text searching for.
                    Buffer As Asciiz,       ' Buffer for line if found.
                    ByVal BufSize As Long)  ' Size of 'Buffer'.
                  As Long

       REMARKS  The seeExtractText function is used to search the text
                buffer 'Source' for text 'Text'. If found, the entire line
                is copied to 'Buffer', up to a maximum of 'BufSize' bytes.

                The primary purpose of seeExtractText is to extract header
                lines from the buffer after calling seeGetEmailLines.

                The seeExtractText does not require a connection to a SMTP
                or POP3 server.

                For an example of use, see the STATUS sample program.

       RETURNS  Number of bytes placed in 'Buffer'.

       EXAMPLE

                Dim Temp As Asciiz * 80
                Dim From As Asciiz * 20

                From = "From: "
                ' search 'Source' for the line containing "From:"
                Code = seeExtractText(Source, From, Temp, 80&)
                ' print line if found
                IF Code > 0 THEN
                  PRINT Temp
                END IF

      ALSO SEE  seeGetEmailLines.

















     SEE4PB Reference Manual                                   Page 10


      +------------------+------------------------------------------------+
      | seeGetEmailCount | Get number of email messages on server.        |
      +------------------+------------------------------------------------+


        SYNTAX  Declare Function seeGetEmailCount() As Long

       REMARKS  The seeGetEmailCount function returns the number of
                messages waiting on the server, independent of whether
                they have been previously read.

                If you have disabled the driver AUTO_CALL capability,
                the message count must be found by

                   Count = seeStatistics(SEE_GET_MSG_COUNT)

                after calling seeDriver until it returns 0. Refer to the
                STATUS sample program for an example of use.

       RETURNS  < 0 : An error has occurred. See the error list
                >=0 : The number of email messages waiting (if AUTO_CALL
                      was disabled).

       EXAMPLE

                ' connect to POP3 server
                Code = seePop3Connect(...)
                ' get # messages waiting
                Code = seeGetEmailCount()
                PRINT Str(Code) + "  messages waiting"

      ALSO SEE  seeGetEmailLines.

























     SEE4PB Reference Manual                                   Page 11


      +-----------------+-------------------------------------------------+
      | seeGetEmailFile | Read email message & save to a file.            |
      +-----------------+-------------------------------------------------+


        SYNTAX  Declare Function seeGetEmailFile(
                    ByVal MsgNbr As Long,   ' header #
                    EmailName As Asciiz,    ' email filename
                    EmailDir As Asciiz,     ' directory for email
                    AttachDir As Asciiz)    ' directory for attachments
                  As Long

       REMARKS  The seeGetEmailFile reads the email message 'MsgNbr',
                saving it to disk as filename 'EmailName' in directory
                'EmailDir', and saving MIME attachments to directory
                'AttachDir'.

                Be sure that the specified directories exist before calling
                this function. Use '.' to specify the current directory.

                Also note that a older file of the same name as being saved
                will be overwritten by the newer file.


       RETURNS  < 0 : An error has occurred. See the error list

       EXAMPLE

                ' read message 1 and save as MYMAIL.TXT in
                ' the current directory

                Code = seeGetEmailFile(1, "mymail.txt", ".", ".")
                IF Code < 0 THEN
                  ... handle error code
                END IF

      ALSO SEE  seeGetEmailLines.




















     SEE4PB Reference Manual                                   Page 12


      +------------------+------------------------------------------------+
      | seeGetEmailLines | Read lines from email message.                 |
      +------------------+------------------------------------------------+


        SYNTAX  Declare Function seeGetEmailLines(
                    ByVal MsgNbr As Long,   ' message #
                    ByVal Lines As Long,    ' # lines
                    Buffer As Asciiz,       ' buffer for email
                    ByVal Size As Long)     ' size of buffer
                  As Long

       REMARKS  The seeGetEmailLines function reads all header lines plus
                the number of body lines specified by the 'Lines' argument
                into 'Buffer', up to a maximum of 'Size' bytes.

                The primary purpose of this function is to read the header
                lines without having to read the entire message.

                If you have disabled the driver AUTO_CALL capability,
                the size must be found by

                   Count = seeStatistics(SEE_GET_BUFFER_COUNT)

                after calling seeDriver until it returns 0.

                See the STATUS sample code for an example of use.

       RETURNS  < 0 : An error has occurred. See the error list.
                >=0 : The number of bytes read (if AUTO_CALL
                      was disabled).

       EXAMPLE

                Dim Buffer As Asciiz * 1024
                . . .
                ' read header lines for email # 1
                Code = seeGetEmailLines(1,0,Buffer,1024)

      ALSO SEE  seeGetEmailFile

















     SEE4PB Reference Manual                                   Page 13


      +-----------------+-------------------------------------------------+
      | seeGetEmailSize | Get size of email message in bytes.             |
      +-----------------+-------------------------------------------------+


        SYNTAX  Declare Function seeGetEmailSize(
                    ByVal MsgNbr As Long)    ' message number
                  As Long

       REMARKS  The seeGetEmailSize function returns the size in bytes of
                the specified message # 'MsgNbr'.

                seeGetEmailSize returns the size of the entire email
                message, including any attachments. Note that attachments
                will be encoded (MIME, UUENCODE, etc.), and thus take up
                more room than after they are decoded.

                If you have disabled the driver AUTO_CALL capability,
                the size must be found by

                   Count = seeStatistics(SEE_GET_MSG_SIZE)

                after calling seeDriver until it returns 0.

                See the READER sample code for an example of use.

       RETURNS  < 0 : An error has occurred. See the error list
                >=0 : The size of the email in bytes on the server
                      (if AUTO_CALL was disabled).

       EXAMPLE  long FileSize;
                . . .
                ' get size of email message # 3
                FileSize = seeGetEmailSize(3)


      ALSO SEE  seeGetEmailCount.




















     SEE4PB Reference Manual                                   Page 14


      +-----------------+-------------------------------------------------+
      | seeIntegerParam | Sets SEE integer parameter.                     |
      +-----------------+-------------------------------------------------+


        SYNTAX  Declare Function seeIntegerParam(
                    ByVal ParmIndex As Long,   ' Parameter index (see below).
                    ByVal ParmValue As Long)   ' Value of parameter to set.
                  As Long

       REMARKS The seeIntegerParam is used to set an integer parameter.
                For more information, refer to the Users Manual. All times
                are in milliseconds.

                        Parameter Name     Default
                 SEE_MIN_RESPONSE_WAIT  :  100
                 SEE_MAX_RESPONSE_WAIT  :  25000
                     SEE_MIN_LINE_WAIT  :  20
                     SEE_MAX_LINE_WAIT  :  25000
                      SEE_CONNECT_WAIT  :  60000
                  SEE_QUOTED_PRINTABLE  :  0
                  SEE_AUTO_CALL_DRIVER  :  1
                        SEE_FILE_PREFIX :  0

                SEE_MIN_RESPONSE_WAIT is the delay before looking for the
                server's response.

                SEE_MAX_RESPONSE_WAIT is the time after which a
                "time-out" error occurs if the server has not responded.

                SEE_MIN_LINE_WAIT is the delay before checking if the
                server is ready to accept the next line of input.

                SEE_MAX_LINE_WAIT is the time after which a "time-out"
                error is declared if the server has not responded.

                SEE_CONNECT_WAIT is the maximum time allowed to complete a
                connection to the SMTP server.


                (continued on next page)
















     SEE4PB Reference Manual                                   Page 15


                SEE_QUOTED_PRINTABLE controls whether messages are (1)
                or are not (0) encoded as quoted-printable. Incoming
                messages that are quoted are always converted regardless of
                the state of this feature.

                SEE_AUTO_CALL_DRIVER controls whether seeDriver is called
                automatically (to completion) after seeSmtpConnect or
                seePop3Connect has been called. Refer to the Users manual
                for more details on the operation of seeDriver.

                SEE_FILE_PREFIX controls whether "1-", "2-", etc. is
                prefixed to the filename of each attachment. If two
                attachments are named FILEONE.ZIP and FILETWO.ZIP, they
                will be saved as 1-FILEONE.ZIP and 2-FILETWO.ZIP.

                Note that Windows 3.1 may truncate long filenames.

                This feature should always be used unless you are
                downloading to a directory specifically for downloaded
                attachments.

       EXAMPLE


                ' enable quoting
                Code = seeIntegerParam(SEE_QUOTED_PRINTABLE, 1)

                ' disable auto call feature
                Code = seeIntegerParam(SEE_AUTO_CALL_DRIVER, 0)

                ' enable attachment file prefixes
                Code = seeIntegerParam(SEE_FILE_PREFIX, 1)

                ' set maximum response wait to 45 seconds
                Code = seeIntegerParam(SEE_MAX_RESPONSE_WAIT, 45000)


      ALSO SEE  seeStringParam.



















     SEE4PB Reference Manual                                   Page 16


      +----------------+--------------------------------------------------+
      | seePop3Connect | Connects to POP3 Server.                         |
      +----------------+--------------------------------------------------+


        SYNTAX  Declare Function seePop3Connect(
                    Pop3Ptr As Asciiz,  ' Pop3 server name
                    UserPtr As Asciiz,  ' POP3 user name.
                    PassPtr As Asciiz)  ' POP3 password.
                  As Long

       REMARKS  The seePop3Connect function establishes a connection with
                the POP3 server as specified by the Server argument.

                Your POP3 server name will typically be named
                "mail.XXX.com" where XXX is your email address, such as
                name@XXX.com. Your POP3 server name can also be found in
                the setup information for your normal email client, such as
                Eudora or Microsoft Outlook.

                The POP3 server name can also be specified in dotted
                decimal notation if wanted. For example "10.23.231.1".

                SEE can not be connected to both the SMTP server and the
                POP3 server at the same time. Call seeClose to terminate
                one connection before connecting again.

                Refer to the SEE4PB Users Manual for more information.

       RETURNS  < 0 : An error has occurred. See the error list.

       EXAMPLE

                Dim Code As Long
                Code = seePop3Connect(
                          "mail.myisp.com",  ' POP3 server
                          "billbob",         ' user
                          "xxx")            ' password

      ALSO SEE  seeSmtpConnect and seeClose.

















     SEE4PB Reference Manual                                   Page 17


      +--------------+----------------------------------------------------+
      | seeSendEmail | Sends email and attachments.                       |
      +--------------+----------------------------------------------------+


        SYNTAX  Declare Function seeSendEmail(
                    To As Asciiz,     ' Recipient, separated by commas.
                    CC As Asciiz,     ' CC list, separated by commas.
                    BCC As Asciiz,    ' BCC list, separated by commas.
                    Subj As Asciiz,   ' Subject text.
                    Msg As Asciiz,    ' Message or message filename.
                    Attach As Asciiz) ' File attachment.
                  As Long

       REMARKS  The seeSendEmail function is used to send email once a
                connection has been made to your SMTP server after calling
                seeSmtpConnect.

                Note that all email addresses (in To, CC, and BCC strings)
                must be bracketed. For example:

                   "Mike M<mike@marshallsoft.com>"

                The CC and BCC strings may contain multiple email
                addresses, separated by commas. For example:

                   "Billy Bob<bbob@isp.com>,Buster<bm@isp.com>"

                If the first character of the message (fifth argument) is
                a '@', then it is considered as the filename which contains
                the message to send.

                'Attach' may contain one or more attachments, separated by
                commas. For example,

                   "file1.zip,file2.doc".

       RETURNS  < 0 : An error has occurred. See the error list.

       EXAMPLE

              Dim NullString As Asciiz * 2
              NullString = Chr$(0)

              seeSendEmail("<myfriend@hisisp.com>",  ' recipient
                           NullString,               ' CC list
                           NullString,               ' BCC list
                           "Hello",                  ' subject
                           "Call me ASAP!",          ' message
                           NullString)               ' attachment

      ALSO SEE  seeSmtpConnect.





     SEE4PB Reference Manual                                   Page 18


      +----------------+--------------------------------------------------+
      | seeSmtpConnect | Connects to SMTP server.                         |
      +----------------+--------------------------------------------------+


        SYNTAX  Declare Function seeSmtpConnect(
                    Server As Asciiz,  ' SMTP server.
                    From As Asciiz,    ' Your email addr in brackets.
                    ReplyTo As Asciiz) ' Email address to reply to.
                  As Long

       REMARKS  The seeSmtpConnect function establishes a connection with
                the SMTP server as specified by the 'Server' argument.

                Your SMTP server name will typically be named
                "mail.XXX.com" where XXX is your email address, such as
                name@XXX.com. Your SMTP server name can also be found in
                the setup information for your normal email client, such as
                Eudora or Microsoft Outlook.

                The SMTP server name can also be specified in dotted
                decimal notation if wanted. For example "10.23.231.1".

                The 'From' string is required and must be enclosed in "<>"
                brackets, such as "Mike M<mike@marshallsoft.com>".

                The 'ReplyTo' string is optional and is used for the
                "Reply-To:" header line. If used, the email address must be
                enclosed in "<>" brackets.

                SEE can not be connected to both the SMTP server and the
                POP3 server at the same time. Call seeClose to terminate
                one connection before connecting again.

       RETURNS < 0 : An error has occurred. See the error list.

       EXAMPLE

                Dim NullString As Asciiz * 2
                NullString = Chr$(0)

                seeSmtpConnect("mail.myisp.com",   ' my SMTP server
                               "<me@myisp.com>",   ' my email address
                               NullString)         ' no Reply-To

                seeSmtpConnect("mail.myisp.com",   ' my SMTP server
                               "<me@myisp.com>",   ' my email address
                               "<him@himisp.com>)  ' Reply-To address

      ALSO SEE  seeClose.







     SEE4PB Reference Manual                                   Page 19


      +---------------+---------------------------------------------------+
      | seeStatistics | Returns runtime statistics.                       |
      +---------------+---------------------------------------------------+


        SYNTAX  Declare Function seeStatistics(
                    ByVal Index As Long)   ' Specifies which statistic.
                  As Long

       REMARKS  The seeStatistics function is used to return runtime
                statistics in the SEE DLL. The values of 'Index' are
                defined in SEE32.BAS as follows:

                      SEE_GET_VERSION : Gets the SEE version number.
                   SEE_GET_SOCK_ERROR : Gets last socket error.
                      SEE_GET_COUNTER : Gets # times driver called.
                     SEE_GET_RESPONSE : Gets last SMTP response code.
                SEE_GET_MESSAGE_BYTES_READ : Gets # message bytes read.
                 SEE_GET_ATTACH_BYTES_READ : Gets # attachment bytes read.
                  SEE_GET_TOTAL_BYTES_READ : Gets total of above two.
                SEE_GET_MESSAGE_BYTES_SENT : Gets # message bytes sent.
                 SEE_GET_ATTACH_BYTES_SENT : Gets # attachment bytes sent.
                  SEE_GET_TOTAL_BYTES_SENT : Gets total of above two.
                         SEE_GET_MSG_COUNT : Gets # emails waiting.
                          SEE_GET_MSG_SIZE : Gets size of email.
                      SEE_GET_BUFFER_COUNT : Gets # bytes in buffer for
                                             seeGetEmailLines.
                    SEE_GET_CONNECT_STATUS : Returns TRUE if connected.
                     SEE_GET_VERIFY_STATUS : Returns seeVerifyUser status.
                      SEE_GET_ATTACH_COUNT : Gets # attachments received.

                The number of message bytes sent will usually be larger
                than your message size because of SMTP protocol overhead.

                The number of attachment bytes sent will be at least
                one-third larger than the actual attachment since every 3
                bytes are encoded as 4 7-bit ASCII bytes before being
                transmitted.

                The purpose of "...BYTES_READ" and "...BYTES_SENT" is to
                provide the ability to track the transmission progress of
                large messages and attachments. See the READER example.

       EXAMPLE

                ' get total message & attachment bytes transmitted.

                Code = seeStatistics(SEE_GET_TOTAL_BYTES_SENT)

      ALSE SEE  seeDriver, seeIntegerParam, and seeStringParam.







     SEE4PB Reference Manual                                   Page 20


      +----------------+--------------------------------------------------+
      | seeStringParam | Sets SEE string parameter.                       |
      +----------------+--------------------------------------------------+


        SYNTAX  Declare Function seeStringParam(
                    ByVal ParamName As Long,  ' Index of parameter.
                    ParamString As Asciiz)    ' Parameter string.
                  As Long

       REMARKS  The seeStringParam function is used to set a string
                parameter as defined in SEE32.BAS. For more information,
                refer to the Users Manual.

                SEE_LOG_FILE : Specifies the log filename.

                The log file is used to debug a SMTP/POP3 session. Be
                advised that log files can be quite large. Don't use them
                unless necessary.

                SEE_SET_REPLY : Sets the "Reply-To" header.

                The "Reply-To:" header string can be set after connecting.

       EXAMPLE

                ' specify a log file.

                seeStringParam(SEE_LOG_FILE, "mytest.log")

                ' specify "Reply-To:" address

                seeStringParam(SEE_SET_REPLY, "<bill@microsoft.com>");

      ALSO SEE  seeIntegerParam.






















     SEE4PB Reference Manual                                   Page 21


      +-----------------+-------------------------------------------------+
      | seeVerifyFormat | Check email address format.                     |
      +-----------------+-------------------------------------------------+


        SYNTAX  Declare Function seeVerifyFormat(
                    Text As Asciiz)    ' Email address to check.
                  As Long

       REMARKS  The seeVerifyFormat function is used to test an individual
                email address for proper formatting. If this function
                returns 0 or above, then the email address is properly
                formatted. But, if this function returns a negative value,
                the email address is either badly formatted, or it uses
                characters (such as '%') that are not normally used as part
                of an email address.

                Note that left and right brackets ('<' and '>') must
                surround the email address.

       EXAMPLE

                Dim Buffer As Asciiz * 80

                . . .

                Code = seeVerifyFormat("Billy E. Bob<beb@hisasp.com>")
                IF Code < 0 THEN
                   Code = seeErrorText(Code,Buffer,80)
                   PRINT "Email address error : " + Buffer
                   EXIT SUB
                END IF

      ALSO SEE  seeErrorText.























     SEE4PB Reference Manual                                   Page 22


      +---------------+---------------------------------------------------+
      | seeVerifyUser | Verify email address.                             |
      +---------------+---------------------------------------------------+


        SYNTAX  Declare Function seeVerifyUser(
                     Text As Asciiz)   ' Email address to verify.

       REMARKS  The seeVerifyUser function is used to verify an individual
                email address with the email server which "owns" the email
                address.

                seeVerify will connect to the specified server and request
                verification of the user. Some SMTP servers may refuse
                connection of any client not directly connected to them or
                may refuse all "verify user" requests. Web based email
                servers such as hotmail.com may refuse all SMTP
                connections.

                Note that you connect to the remote SMTP server rather than
                the SMTP server that you use to send email.

                For example, to verify msc@traveller.com, you must first
                connect to the SMTP server "mail.traveller.com" then call
                SeeVerifyUser("msc").

                Refer to VERUSR.C for an example of the seeVerifyUser
                function.

       EXAMPLE

                Dim Code As Long
                Dim SmtpServer As Asciiz * 65
                Dim User As Asciiz * 40
                Dim Buffer As Asciiz * 128

                SmtpServer = "mail.traveller.com"
                Usr  = "msc"

                Code = seeSmtpConnect(SmtpServer, ...)
                . . .
                Code = seeVerifyUser(UserPtr)
                If Code = 0 THEN
                  ' display last server response
                  Code =  seeDebug(SEE_GET_LAST_RESPONSE, Buffer, 128)
                  Print Left(User,Code); " is NOT verified"
                Else
                  Print Left(User,Code); " is verified"
                End If

      ALSO SEE  seeErrorText and seeDebug.






     SEE4PB Reference Manual                                   Page 23

