#ifndef SMTP_STRUCT_H
#define SMTP_STRUCT_H

#include "smtp_const.h"

typedef struct smtp_message
{
	unsigned char	 recipientNum;
	char recipient[MAX_RECEIPTOR_PER_MSG][SMTP_ADDR_LENGTH]; 
	char sender[SMTP_ADDR_LENGTH];                    
	unsigned char contents[MAX_EMAIL_LENGTH];
	unsigned char subject[MAX_SMTP_SUBJECT_LENGTH];
	char subject_coding[20];
	char contents_coding[20];
	char parsed_flag;//0-parse failed 1-parse sucess             
}SMTP_MSG;

/* SMTP client structure */
struct tSmtpPort 
{
	int sockfd;
	unsigned char curr_state;
	unsigned char port_state;
	unsigned char send_buf[SMTP_SEND_BUF_SIZE];
	unsigned char recv_buf[SMTP_RECV_BUF_SIZE]; //100
	SMTP_MSG smtp_msg;  //746
	unsigned char recipient_index;
	unsigned char count;
	unsigned char encode_mode;
	unsigned short recv_offset;
	unsigned short time_out;
	unsigned char overflow;
};

#endif   /* SMTP_STRUCT_H */
