VMime
SMTPTransport Class Reference

#include <SMTPTransport.hpp>

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::authenticatorgetAuthenticator () const
shared_ptr< security::authenticatorgetAuthenticator ()
void setAuthenticator (shared_ptr< security::authenticator > auth)
void setCertificateVerifier (shared_ptr< security::cert::certificateVerifier > cv)
shared_ptr< security::cert::certificateVerifiergetCertificateVerifier ()
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()

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

◆ ~SMTPTransport()

References disconnect(), and isConnected().

Member Function Documentation

◆ connect()

void connect ( )
virtual

Connect to service.

Implements service.

References vmime::dynamicCast(), service::getAuthenticator(), and isConnected().

◆ disconnect()

void disconnect ( )
virtual

Disconnect from service.

Implements service.

References isConnected().

Referenced by ~SMTPTransport().

◆ getConnection()

shared_ptr< SMTPConnection > getConnection ( )

◆ getConnectionInfos()

shared_ptr< connectionInfos > getConnectionInfos ( ) const
virtual

Get information about the connection.

Returns
information about the connection

Implements service.

◆ getInfos()

const serviceInfos & getInfos ( ) const
virtual

Return information about this service.

Returns
information about the service

Implements service.

Referenced by send().

◆ getInfosInstance()

const serviceInfos & getInfosInstance ( )
static

Referenced by SMTPTransport().

◆ getProtocolName()

const string getProtocolName ( ) const
virtual

Return the protocol name of this service.

Returns
protocol name

Implements service.

◆ isConnected()

bool isConnected ( ) const
virtual

Test whether this service is connected.

Returns
true if the service is connected, false otherwise

Implements service.

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

◆ isSecuredConnection()

bool isSecuredConnection ( ) const
virtual

Check whether the connection is secured.

Returns
true if the connection is secured, false otherwise

Implements service.

◆ isSMTPS()

bool isSMTPS ( ) const

◆ noop()

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 isConnected(), and SMTPCommand::NOOP().

◆ send() [1/2]

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(), dotFilteredOutputStream::flush(), and isConnected().

Referenced by send().

◆ send() [2/2]

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(), getInfos(), service::getSession(), isConnected(), send(), and context::setInternationalizedEmailSupport().


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