home *** CD-ROM | disk | FTP | other *** search
/ vsiftp.vmssoftware.com / VSIPUBLIC@vsiftp.vmssoftware.com.tar / FREEWARE / FREEWARE40.ZIP / pine / c-client / smtp.h < prev    next >
C/C++ Source or Header  |  1994-01-09  |  3KB  |  91 lines

  1. /*
  2.  * Program:    Simple Mail Transfer Protocol (SMTP) routines
  3.  *
  4.  * Author:    Mark Crispin
  5.  *        Networks and Distributed Computing
  6.  *        Computing & Communications
  7.  *        University of Washington
  8.  *        Administration Building, AG-44
  9.  *        Seattle, WA  98195
  10.  *        Internet: MRC@CAC.Washington.EDU
  11.  *
  12.  * Date:    27 July 1988
  13.  * Last Edited:    18 June 1992
  14.  *
  15.  * Sponsorship:    The original version of this work was developed in the
  16.  *        Symbolic Systems Resources Group of the Knowledge Systems
  17.  *        Laboratory at Stanford University in 1987-88, and was funded
  18.  *        by the Biomedical Research Technology Program of the National
  19.  *        Institutes of Health under grant number RR-00785.
  20.  *
  21.  * Original version Copyright 1988 by The Leland Stanford Junior University.
  22.  * Copyright 1992 by the University of Washington.
  23.  *
  24.  *  Permission to use, copy, modify, and distribute this software and its
  25.  * documentation for any purpose and without fee is hereby granted, provided
  26.  * that the above copyright notices appear in all copies and that both the
  27.  * above copyright notices and this permission notice appear in supporting
  28.  * documentation, and that the name of the University of Washington or The
  29.  * Leland Stanford Junior University not be used in advertising or publicity
  30.  * pertaining to distribution of the software without specific, written prior
  31.  * permission.  This software is made available "as is", and
  32.  * THE UNIVERSITY OF WASHINGTON AND THE LELAND STANFORD JUNIOR UNIVERSITY
  33.  * DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, WITH REGARD TO THIS SOFTWARE,
  34.  * INCLUDING WITHOUT LIMITATION ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
  35.  * FITNESS FOR A PARTICULAR PURPOSE, AND IN NO EVENT SHALL THE UNIVERSITY OF
  36.  * WASHINGTON OR THE LELAND STANFORD JUNIOR UNIVERSITY BE LIABLE FOR ANY
  37.  * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
  38.  * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
  39.  * CONTRACT, TORT (INCLUDING NEGLIGENCE) OR STRICT LIABILITY, ARISING OUT OF
  40.  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  41.  *
  42.  */
  43.  
  44. /* Constants */
  45.  
  46. #define SMTPTCPPORT (long) 25    /* assigned TCP contact port */
  47. #define SMTPGREET (long) 220    /* SMTP successful greeting */
  48. #define SMTPOK (long) 250    /* SMTP OK code */
  49. #define SMTPREADY (long) 354    /* SMTP ready for data */
  50. #define SMTPSOFTFATAL (long) 421/* SMTP soft fatal code */
  51. #define SMTPHARDERROR (long) 554/* SMTP miscellaneous hard failure */
  52.  
  53.  
  54. /* SMTP I/O stream */
  55.  
  56. typedef struct smtp_stream {
  57.   void *tcpstream;        /* TCP I/O stream */
  58.   char *reply;            /* last reply string */
  59.   unsigned int debug : 1;    /* stream debug flag */
  60. } SMTPSTREAM;
  61.  
  62.  
  63. /* Coddle certain compilers' 6-character symbol limitation */
  64.  
  65. #ifdef __COMPILER_KCC__
  66. #define smtp_open sopen
  67. #define smtp_close sclose
  68. #define smtp_mail smail
  69. #define smtp_debug sdebug
  70. #define smtp_nodebug sndbug
  71. #define smtp_rcpt srcpt
  72. #define smtp_address saddr
  73. #define smtp_send ssend
  74. #define smtp_reply sreply
  75. #define smtp_fake sfake
  76. #endif
  77.  
  78.  
  79. /* Function prototypes */
  80.  
  81. SMTPSTREAM *smtp_open  ();
  82. void smtp_close  ();
  83. long smtp_mail  ();
  84. void smtp_debug  ();
  85. void smtp_nodebug  ();
  86. void smtp_rcpt  ();
  87. long smtp_send  ();
  88. long smtp_reply  ();
  89. long smtp_fake  ();
  90. long smtp_soutr  ();
  91.