00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #include "SMTPClient.h"
00019
00020 namespace oasys {
00021
00022 SMTPClient::SMTPClient(const char* logpath)
00023 : TCPClient(logpath, true ),
00024 in_(this), out_(this),
00025 smtp_(&in_, &out_, SMTP::DEFAULT_CONFIG, logpath),
00026 first_session_(true)
00027 {
00028 }
00029
00030 int
00031 SMTPClient::send_message(SMTPSender* sender)
00032 {
00033 int ret = smtp_.client_session(sender, first_session_);
00034 first_session_ = false;
00035 return ret;
00036 }
00037
00038 SMTPFdClient::SMTPFdClient(int fd_in, int fd_out, const char* logpath)
00039 : fdio_in_(fd_in), fdio_out_(fd_out),
00040 in_(&fdio_in_), out_(&fdio_out_),
00041 smtp_(&in_, &out_, SMTP::DEFAULT_CONFIG, logpath),
00042 first_session_(true)
00043 {
00044 }
00045
00046 int
00047 SMTPFdClient::send_message(SMTPSender* sender)
00048 {
00049 int ret = smtp_.client_session(sender, first_session_);
00050 first_session_ = false;
00051 return ret;
00052 }
00053
00054 }