www.pudn.com > FindMail.zip > SMTPClient.h
#pragma once
#include "dnsclient.h"
#define SMTP_WELCOME 220
#define SMTP_BYE 221
#define SMTP_OK 250
#define SMTP_INVALID_USER 550
#define SMTP_DATA 354
class CSMTPClient
{
public:
CSMTPClient(int num=0);
~CSMTPClient(void);
int ConnectHost(char * host=NULL, int port=25);
int Login(char * user, char * password);
int command(char * fmt, ...);
int GetReply(void);
// 连接后的socket句柄
int m_sd;
int m_client_num;
// 得到的应答消息
char m_reply[2048];
int Disconnect(void);
int m_mx_server_count;
char **m_mx_servers;
int Rcpt(char * email_addr);
// random from name and domain
char m_random_name[10];
char m_random_domain[64];
int From(char * email_addr);
char m_errmsg[256];
char m_host[64];
char m_domain_name[64];
int m_port;
};