Dallas Semiconductor DS80C400 C Libraries Home Page

Main Page   Data Structures   File List   Data Fields   Globals  

tini400_smtp.h

Go to the documentation of this file.
00001 /* --------------------------------------------------------------------------------------
00002  *  Copyright (C) 2003 Dallas Semiconductor Corporation, All Rights Reserved.
00003  * 
00004  *  Permission is hereby granted, free of charge, to any person obtaining a
00005  *  copy of this software and associated documentation files (the "Software"),
00006  *  to deal in the Software without restriction, including without limitation
00007  *  the rights to use, copy, modify, merge, publish, distribute, sublicense,
00008  *  and/or sell copies of the Software, and to permit persons to whom the
00009  *  Software is furnished to do so, subject to the following conditions:
00010  * 
00011  *  The above copyright notice and this permission notice shall be included
00012  *  in all copies or substantial portions of the Software.
00013  * 
00014  *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
00015  *  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00016  *  MERCHANTABILITY,  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
00017  *  IN NO EVENT SHALL DALLAS SEMICONDUCTOR BE LIABLE FOR ANY CLAIM, DAMAGES
00018  *  OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
00019  *  ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
00020  *  OTHER DEALINGS IN THE SOFTWARE.
00021  * 
00022  *  Except as contained in this notice, the name of Dallas Semiconductor
00023  *  shall not be used except as stated in the Dallas Semiconductor
00024  *  Branding Policy.
00025  * ---------------------------------------------------------------------------
00026  */
00027 
00028 #ifndef __rom400_smtp_
00029 #define __rom400_smtp_
00030 
00048 #define MAX_LINE_SIZE 1024
00049 
00054 #define SMTP_VERSION                            1
00055 
00059 #define SMTP_MAXATTACHMENTSIZE          5
00060 
00064 #define SMTP_MAXUSERHEADERSIZE    20
00065 
00066 //Error values definition
00070 #define SMTP_INSUFFICIENT_MEMORY  -1
00071 
00075 #define SMTP_SENDMAIL_ERROR         -2  
00076 
00081 #define SMTP_MAILHOST_NOT_FOUND   -3
00082 
00087 #define SMTP_FILE_NOT_FOUND             -4
00088 
00092 #define SMTP_SOCKET_ERROR                 -7
00093 
00098 #define SMTP_MAIL_QUEUED                        -8
00099 
00104 #define SMTP_INVALID_MAILNODE_ADDRESS    -9
00105 
00109 #define SMTP_LIBRARY_IS_NOT_CONFIGURED -11
00110 
00114 #define SMTP_STATUS_SUCCESS              0
00115 
00119 typedef struct _hostinfo 
00120 {
00121   long dns_primary_address;       
00122   long dns_secondary_address;     
00123   long dns_timeout;               
00124   long mailqueue_timeinterval;    
00125   long smtp_host;                 
00126   char *localhostname;            
00127 } hostinfo;
00128 
00132 typedef struct _mailheader
00133 {
00134   char *from_id;        
00135   char *sendername;     
00136   char *to_id;          
00137   char *recipientname;  
00138   char *subject;        
00139   char *reply_to_id;    
00140   char *cc_id;          
00141   char *bcc_id;         
00142   char *errors_to_id;   
00143   char *date;           
00144 } mailheader;
00145 
00149 typedef struct _userheader
00150 {
00151   char *headernamelist[SMTP_MAXUSERHEADERSIZE];   
00152   char *headervaluelist[SMTP_MAXUSERHEADERSIZE];  
00153 } userheader;
00154 
00160 unsigned int smtp_version(void);
00161 
00171 void smtp_init(void);
00172 
00185 void smtp_sethostinfo(struct _hostinfo *phostinfo);
00186 
00202 void smtp_setdefaultheadervalue(struct _mailheader *pmhdr);
00203 
00220 void smtp_setuserheaderlist(struct _userheader *pusrhdr);
00221 
00262 int smtp_sendmail(struct _mailheader mail_header, char *msg, 
00263                   char *attachmentlist[SMTP_MAXATTACHMENTSIZE], 
00264                   char queuemail_flag, unsigned long *mailnodeaddress);
00265 
00280 int smtp_removemailfromqueue(unsigned long pmailnode_address);
00281 
00297 int smtp_getqueuedmailstatus(unsigned long  pmailnode_address);
00298 
00299 #endif

Copyright 2004 Dallas Semiconductor, Inc.. Documentation generated by Doxygen.