VMime
SMTPTransport Class Reference
Inheritance diagram for SMTPTransport:
Collaboration diagram for SMTPTransport:

Public Member Functions

 SMTPTransport (shared_ptr< session > sess, shared_ptr< security::authenticator > auth, const bool secured=false)
 
 ~SMTPTransport ()
 
const string getProtocolName () const
 
const serviceInfosgetInfos () const
 
void connect ()
 
bool isConnected () const
 
void disconnect ()
 
void noop ()
 
void send (const mailbox &expeditor, const mailboxList &recipients, utility::inputStream &is, const size_t size, utility::progressListener *progress=NULL, const mailbox &sender=mailbox())
 
void send (shared_ptr< vmime::message > msg, const mailbox &expeditor, const mailboxList &recipients, utility::progressListener *progress=NULL, const mailbox &sender=mailbox())
 
bool isSecuredConnection () const
 
shared_ptr< connectionInfosgetConnectionInfos () const
 
shared_ptr< SMTPConnectiongetConnection ()
 
bool isSMTPS () const
 
- Public Member Functions inherited from transport
virtual void send (shared_ptr< vmime::message > msg, utility::progressListener *progress=NULL)
 
Type getType () const
 
- Public Member Functions inherited from service
virtual ~service ()
 
shared_ptr< const sessiongetSession () const
 
shared_ptr< sessiongetSession ()
 
shared_ptr< const
security::authenticator
getAuthenticator () const
 
shared_ptr
< security::authenticator
getAuthenticator ()
 
void setAuthenticator (shared_ptr< security::authenticator > auth)
 
void setCertificateVerifier (shared_ptr< security::cert::certificateVerifier > cv)
 
shared_ptr
< security::cert::certificateVerifier
getCertificateVerifier ()
 
void setSocketFactory (shared_ptr< socketFactory > sf)
 
shared_ptr< socketFactorygetSocketFactory ()
 
void setTimeoutHandlerFactory (shared_ptr< timeoutHandlerFactory > thf)
 
shared_ptr< timeoutHandlerFactorygetTimeoutHandlerFactory ()
 
void setTracerFactory (shared_ptr< tracerFactory > tf)
 
shared_ptr< tracerFactorygetTracerFactory ()
 
template<typename TYPE >
void setProperty (const string &name, const TYPE &value)
 

Static Public Member Functions

static const serviceInfosgetInfosInstance ()
 

Additional Inherited Members

- Public Types inherited from service
enum  Type { TYPE_STORE = 0, TYPE_TRANSPORT }
 
- Protected Member Functions inherited from transport
 transport (shared_ptr< session > sess, const serviceInfos &infos, shared_ptr< security::authenticator > auth)
 
shared_ptr< headerFieldprocessHeaderField (shared_ptr< headerField > field)
 
void processHeader (shared_ptr< header > header)
 
- Protected Member Functions inherited from service
 service (shared_ptr< session > sess, const serviceInfos &infos, shared_ptr< security::authenticator > auth)
 
- Protected Member Functions inherited from object
 object ()
 
 object (const object &)
 
objectoperator= (const object &)
 
virtual ~object ()
 

Detailed Description

SMTP transport service.

Constructor & Destructor Documentation

SMTPTransport ( shared_ptr< session sess,
shared_ptr< security::authenticator auth,
const bool  secured = false 
)

Member Function Documentation

void connect ( )
virtual

Connect to service.

Implements service.

References service::getAuthenticator(), and SMTPTransport::isConnected().

void disconnect ( )
virtual

Disconnect from service.

Implements service.

References SMTPTransport::isConnected().

Referenced by SMTPTransport::~SMTPTransport().

shared_ptr< SMTPConnection > getConnection ( )
shared_ptr< connectionInfos > getConnectionInfos ( ) const
virtual

Get information about the connection.

Returns
information about the connection

Implements service.

const serviceInfos & getInfos ( ) const
virtual

Return information about this service.

Returns
information about the service

Implements service.

const serviceInfos & getInfosInstance ( )
static
const string getProtocolName ( ) const
virtual

Return the protocol name of this service.

Returns
protocol name

Implements service.

bool isConnected ( ) const
virtual

Test whether this service is connected.

Returns
true if the service is connected, false otherwise

Implements service.

Referenced by SMTPTransport::connect(), SMTPTransport::disconnect(), SMTPTransport::noop(), and SMTPTransport::~SMTPTransport().

bool isSecuredConnection ( ) const
virtual

Check whether the connection is secured.

Returns
true if the connection is secured, false otherwise

Implements service.

bool isSMTPS ( ) const
void noop ( )
virtual

Do nothing but ensure the server do not disconnect (for example, this can reset the auto-logout timer on the server, if one exists).

Implements service.

References SMTPTransport::isConnected(), and SMTPCommand::NOOP().

void send ( const mailbox expeditor,
const mailboxList recipients,
utility::inputStream is,
const size_t  size,
utility::progressListener progress = NULL,
const mailbox sender = mailbox() 
)
virtual

Send a message over this transport service.

Parameters
expeditorexpeditor mailbox
recipientslist of recipient mailboxes
isinput stream providing message data (header + body)
sizesize of the message data
progressprogress listener, or NULL if not used
senderenvelope sender (if empty, expeditor will be used)

Implements transport.

References vmime::utility::bufferedStreamCopy().

void send ( shared_ptr< vmime::message msg,
const mailbox expeditor,
const mailboxList recipients,
utility::progressListener progress = NULL,
const mailbox sender = mailbox() 
)
virtual

Send a message over this transport service.

The default implementation simply generates the whole message into a string buffer and "streams" it via a inputStreamStringAdapter.

Parameters
msgmessage to send
expeditorexpeditor mailbox
recipientslist of recipient mailboxes
progressprogress listener, or NULL if not used
senderenvelope sender (if empty, expeditor will be used)

Reimplemented from transport.

References SMTPChunkingOutputStreamAdapter::flush(), generationContext::getDefaultContext(), and context::setInternationalizedEmailSupport().


The documentation for this class was generated from the following files: