www.pudn.com > antispam-addin.rar > deliver.hxx
#ifndef DELIVER_H_
#define DELIVER_H_
#include "exception.hxx"
#include "conmunicate.hxx"
#include "configure.hxx"
#define COMMAND_LEN 64
#define RESPONSE_LEN 256
class Conmunicate;
class Deliver:public Exception
{
public:
Deliver();
virtual ~Deliver();
public:
bool Login(Configure *pConfigure);
bool Logoff();
bool SendMail(char *pszMail,int nMailLen);
private:
bool IsResponseOK(int nRequestType);
private:
Conmunicate *m_pConmunicate;
char szCommand[COMMAND_LEN];
char m_Result[RESPONSE_LEN];
struct response_code
{
char* sResponse; // Response we're looking for
char* sMessage; // Error message if we don't get it
};
enum eResponse
{// MAP TO response_table
HELO = 0,
MAIL,
RCPT,
DATA,
DATA_SUCCESS,
DENY_RELAY,
QUIT,
};
static response_code response_table[];
};
#endif//DELIVER_H_