⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mail.h

📁 .net 方面的开发说明资料。
💻 H
字号:
// ========================================================
// ePlug SMTP protocol implementation
//
// Design and implementation by:
// - Floris van den Berg
// ========================================================

#ifndef SMTPPROTOCOL_H
#define SMTPPROTOCOL_H

#define DLL_CALLCONV __stdcall

#ifdef SMTPPROTOCOL_EXPORTS
#define SMTP_API __declspec(dllexport)
#else
#define SMTP_API __declspec(dllimport)
#endif

// --------------------------------------------------------

struct Protocol;

// --------------------------------------------------------

static const GUID CLSID_POP3_PROTOCOL =
{ 0x03e5e194, 0x323d, 0x4330, { 0xae, 0xf6, 0x86, 0x05, 0x8d, 0x47, 0xd0, 0x5b } };

static const GUID CLSID_SMTP_PROTOCOL =
{ 0x23a2c36e, 0xddd9, 0x49de, { 0xaf, 0x57, 0x06, 0xf1, 0xa1, 0xe0, 0x2d, 0x47 } };

static const GUID CLSID_MAILRECV_PROTOCOL = 
{ 0xb48dd894, 0xb85a, 0x4766, { 0x9e, 0x06, 0x1e, 0x9a, 0xb0, 0xbd, 0xe5, 0x34 } };

static const GUID CLSID_IRC_PROTOCOL = 
{ 0xe255b27a, 0x7587, 0x49f5, { 0xbb, 0x07, 0xd1, 0x0d, 0x34, 0x1d, 0xce, 0x49 } };

// --------------------------------------------------------

#pragma pack(push, 1)
struct Pop3Top {
	int message_id;
	int max_lines;
};

struct MailRecvLogin {
	const char *username;
	const char *password;
};

struct MailMessageCount {
	int message_count;
	int octets;
};

struct MailMessageListEntry {
	int message_id;
	int octets;
};

struct MailMessageList {
	int message_count;
	MailMessageListEntry entries[1];
};
#pragma pack(pop)

// --------------------------------------------------------

enum POP3Events {
	POP3_REPLY_OK = 0,
	POP3_REPLY_ERROR,
	POP3_REPLY_LISTING,
	POP3_REPLY_ENDLIST,
	POP3_USER,              // [AUTHORIZATION] user name
	POP3_PASS,              // [AUTHORIZATION] password
	POP3_NOOP,              // no operation (server replies +OK)
	POP3_STAT,              // retrieves the number of mails waiting + size in octets
	POP3_LIST,              // provides information about a particular message
	POP3_RETR,              // retrieves an e-mail
	POP3_DELE,              // deletes an e-mail from the server
	POP3_UIDL,              // retrieves an unique id for a message
	POP3_RSET,              // resets messages that were marked deleted 
	POP3_QUIT,              // logs out from the pop3 server
	POP3_TOP,               // retrieves a given number of lines from a message (not always supported)
};

// --------------------------------------------------------

enum SMTPEvents {
	SMTP_REPLY_SERVICE_READY = 0,
	SMTP_REPLY_SERVICE_NOT_AVAILABLE,
	SMTP_REPLY_SERVICE_CLOSING,
	SMTP_REPLY_SYSTEM_STATUS,
	SMTP_REPLY_HELP_MESSAGE,
	SMTP_REPLY_TRANSACTION_FAILED,
	SMTP_REPLY_USER_FORWARDED,
	SMTP_REPLY_START_MAIL_INPUT,
	SMTP_REPLY_REQUESTED_MAIL_COMPLETED,
	SMTP_REPLY_MAILBOX_UNAVAILABLE,
	SMTP_REPLY_MAILBOX_BUSY,
	SMTP_REPLY_MAILBOX_NAME_NOT_ALLOWED,	
	SMTP_REPLY_LOCAL_ERROR_IN_PROCESSING,
	SMTP_REPLY_INSUFFICIENT_STORAGE,
	SMTP_REPLY_COMMAND_UNREGOGNIZED,
	SMTP_REPLY_INVALID_PARAMETERS,
	SMTP_REPLY_COMMAND_NOT_IMPLEMENTED,
	SMTP_REPLY_PARAMETER_NOT_IMPLEMENTED,
	SMTP_REPLY_BAD_SEQUENCE,
	SMTP_REPLY_USER_NOT_LOCAL,
	SMTP_REPLY_EXCEEDED_STORAGE_ALLOCATION,
	SMTP_MAIL_FROM,
	SMTP_MAIL_TO,
};

// --------------------------------------------------------

#pragma pack(push, 1)
struct IRCUser {
	const char *username;
	const char *hostname;
	const char *servername;
	const char *realname;
};

struct IRCStatusMessage {
	char server[64];
	char message[512];
};

struct IRCReply {
	char nickserver[64];
	char command[32];
	char trailing[32];
	char middle[128];
};

struct IRCChannelTopic {
	char server[64];
	char channel[64];
	char topic[256];
};

struct IRCPrivateMsg {
	char *target;
	char *message;
};

struct IRCReplyPrivateMsg {
	char channel[64];
	char nick[16];
	char mask[64];
	char message[512];
};

struct IRCNick {
	char nick[16];
	char mask[64];
	char channel[256];
};
#pragma pack(pop)

enum IRCEvents {
	IRC_RAW = 0,
	IRC_NOTICEAUTH,
	IRC_STATUS_MESSAGE,
	IRC_CHANNEL_TOPIC,
	IRC_NICK_ENTRY,
	IRC_JOIN,
	IRC_PART,
	IRC_QUIT,	
	IRC_PRIVMSG,
	IRC_MESSAGE,
	IRC_PING,
	IRC_CMD_USER,
	IRC_CMD_NICK,
	IRC_CMD_PASS,
	IRC_CMD_PONG,
	IRC_CMD_JOIN,
	IRC_CMD_PRIVMSG,
};

// --------------------------------------------------------

extern "C" {
	SMTP_API CLSID DLL_CALLCONV EpMailProtocolInit(Protocol *protocol);
	SMTP_API CLSID DLL_CALLCONV EpPOP3ProtocolInit(Protocol *protocol);
	SMTP_API CLSID DLL_CALLCONV EpSMTPProtocolInit(Protocol *protocol);
	SMTP_API CLSID DLL_CALLCONV EpIRCProtocolInit(Protocol *protocol);
	SMTP_API CLSID DLL_CALLCONV EpProtocolInit(unsigned int count, Protocol *protocol);
	SMTP_API unsigned int DLL_CALLCONV EpProtocolCount();

};

#endif // SMTPPROTOCOL_H

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -