class LimitedSmtp implements TransportInterface (View source)

Properties

protected Smtp $transport

The actual transport instance.

protected int $limit

Maximum number of messages to be sent for for every connection.

protected int $sent

Number of messages sent in current connection.

Methods

__construct(Smtp $transport, int $limit)

Initializes the instance.

Smtp
getSmtpTransport()

Get the actual transport instance.

send(Message $message)

{@inheritdoc}

trackLimit()

Increment the counter of sent messages and disconnect the underlying transport if needed.

Details

__construct(Smtp $transport, int $limit)

Initializes the instance.

Parameters

Smtp $transport

the actual transport instance

int $limit

The maximum number of messages to be sent per connection

Smtp getSmtpTransport()

Get the actual transport instance.

Return Value

Smtp

send(Message $message)

{@inheritdoc}

Parameters

Message $message

See also

\Zend\Mail\Transport\TransportInterface::send()

private trackLimit()

Increment the counter of sent messages and disconnect the underlying transport if needed.