Dallas Semiconductor DS80C400 C Libraries Home Page

Main Page | Modules | Data Structures | Directories | 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                            3
00055 
00059 #define SMTP_MAXATTACHMENTSIZE          5
00060 
00064 #define SMTP_MAXUSERHEADERSIZE    20
00065 
00066 //Error values definition
00070 #define SMTP_INSUFFICIENT_MEMORY  -1
00071 
00076 #define SMTP_MAILHOST_NOT_FOUND   -3
00077 
00082 #define SMTP_FILE_NOT_FOUND             -4
00083 
00087 #define SMTP_SOCKET_ERROR                 -7
00088 
00093 #define SMTP_MAIL_QUEUED                        -8
00094 
00099 #define SMTP_INVALID_MAILNODE_ADDRESS    -9
00100 
00104 #define SMTP_LIBRARY_IS_NOT_CONFIGURED -11
00105 
00109 #define SMTP_STATUS_SUCCESS              0
00110 
00114 typedef struct _hostinfo
00115 {
00116   long dns_primary_address;       
00117   long dns_secondary_address;     
00118   long dns_timeout;               
00119   long mailqueue_timeinterval;    
00120   long smtp_host;                 
00121   char *localhostname;            
00122 } hostinfo;
00123 
00124 typedef struct _mailheader
00125 {
00126   char *from_id;        
00127   char *sendername;     
00128   char *to_id;          
00129   char *recipientname;  
00130   char *subject;        
00131   char *reply_to_id;    
00132   char *cc_id;          
00133   char *bcc_id;         
00134   char *errors_to_id;   
00135   char *date;           
00136 } mailheader;    
00137 
00138 typedef struct _userheader
00139 {
00140   char *headernamelist[SMTP_MAXUSERHEADERSIZE];   
00141   char *headervaluelist[SMTP_MAXUSERHEADERSIZE];  
00142 } userheader;   
00143 
00149 unsigned int smtp_version(void);
00150 
00160 void smtp_init(void);
00161 
00174 void smtp_sethostinfo(struct _hostinfo *phostinfo);
00175 
00189 void smtp_setclientsocktimeout(long milli_sec);
00190 
00201 long  smtp_getclientsocktimeout(void);
00202 
00218 void smtp_setdefaultheadervalue(struct _mailheader *pmhdr);
00219 
00236 void smtp_setuserheaderlist(struct _userheader *pusrhdr);
00237 
00278 int smtp_sendmail(struct _mailheader mail_header, char *msg,
00279                   char *attachmentlist[SMTP_MAXATTACHMENTSIZE], 
00280                   char queuemail_flag, unsigned long *mailnodeaddress);
00281 
00296 int smtp_removemailfromqueue(unsigned long pmailnode_address);
00297 
00313 int smtp_getqueuedmailstatus(unsigned long  pmailnode_address);
00314 
00315 #endif

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