Luc@s
30-05-2004, 12:44
Mi sono costruito una struct di una msg SMTP:
/// SMTP command
#define CRLF "\r\n" /// The CRLF string
#define HELO "HELO" /// The helo command
#define EHLO "EHLO" /// The ehlo command
#define FROM "MAIL FROM: " /// MAIL FROM: <>
#define TO "RCPT TO: " /// RCPT TO: <>
#define DATA "DATA" /// The data command
#define RESET "RSET" /// The reset command
#define VERIFY_USER "VRFY " ///The command whitch verify if a string is a valid user [VRFY <string>]
#define NOOP "NOOP" /// The no Operation command
#define QUIT "QUIT" /// The quit command
#define HELP "HELP" /// The help command
/// The SMTP Message record
struct SMTP
{
std::string from; // for command MAIL FROM
std::string to; // for command RCPT TO
std::string data; // for command DATA
SMTP(const std::string& mail_from, const std::string& rcpt_to, const std::string& data_string)
{
from = mail_from;
to = rcpt_to;
data = data_string;
};
inline const char *getFrom() const
{
return from.c_str();
};
inline const char *getTo() const
{
return to.c_str();
};
inline const char *getData() const
{
return data.c_str();
};
};
Ora mi conviene crearci una lista o un vettore???
Tnk
/// SMTP command
#define CRLF "\r\n" /// The CRLF string
#define HELO "HELO" /// The helo command
#define EHLO "EHLO" /// The ehlo command
#define FROM "MAIL FROM: " /// MAIL FROM: <>
#define TO "RCPT TO: " /// RCPT TO: <>
#define DATA "DATA" /// The data command
#define RESET "RSET" /// The reset command
#define VERIFY_USER "VRFY " ///The command whitch verify if a string is a valid user [VRFY <string>]
#define NOOP "NOOP" /// The no Operation command
#define QUIT "QUIT" /// The quit command
#define HELP "HELP" /// The help command
/// The SMTP Message record
struct SMTP
{
std::string from; // for command MAIL FROM
std::string to; // for command RCPT TO
std::string data; // for command DATA
SMTP(const std::string& mail_from, const std::string& rcpt_to, const std::string& data_string)
{
from = mail_from;
to = rcpt_to;
data = data_string;
};
inline const char *getFrom() const
{
return from.c_str();
};
inline const char *getTo() const
{
return to.c_str();
};
inline const char *getData() const
{
return data.c_str();
};
};
Ora mi conviene crearci una lista o un vettore???
Tnk