Check for connection before any operation.
This commit is contained in:
parent
56f5f0dce7
commit
0b9fd48f97
@ -520,6 +520,9 @@ void SMTPTransport::internalDisconnect()
|
|||||||
|
|
||||||
void SMTPTransport::noop()
|
void SMTPTransport::noop()
|
||||||
{
|
{
|
||||||
|
if (!isConnected())
|
||||||
|
throw exceptions::not_connected();
|
||||||
|
|
||||||
sendRequest("NOOP");
|
sendRequest("NOOP");
|
||||||
|
|
||||||
ref <SMTPResponse> resp = readResponse();
|
ref <SMTPResponse> resp = readResponse();
|
||||||
@ -533,6 +536,9 @@ void SMTPTransport::send(const mailbox& expeditor, const mailboxList& recipients
|
|||||||
utility::inputStream& is, const utility::stream::size_type size,
|
utility::inputStream& is, const utility::stream::size_type size,
|
||||||
utility::progressListener* progress)
|
utility::progressListener* progress)
|
||||||
{
|
{
|
||||||
|
if (!isConnected())
|
||||||
|
throw exceptions::not_connected();
|
||||||
|
|
||||||
// If no recipient/expeditor was found, throw an exception
|
// If no recipient/expeditor was found, throw an exception
|
||||||
if (recipients.isEmpty())
|
if (recipients.isEmpty())
|
||||||
throw exceptions::no_recipient();
|
throw exceptions::no_recipient();
|
||||||
|
Loading…
Reference in New Issue
Block a user