File Information
Library: OSP/Mail
Package: Mail
Header: Poco/OSP/Mail/MailDeliveryService.h
Description
This class contains status information about an email message delivery. It also provides events for asynchronous notification about delivery status.
Inheritance
Direct Base Classes: Poco::Notification
All Base Classes: Poco::Notification, Poco::RefCountedObject
Member Summary
Member Functions: exception, message, status, tryWait, updateStatus, wait
Inherited Functions: duplicate, name, referenceCount, release
Types Aliases
Ptr
using Ptr = Poco::AutoPtr < MailDeliveryHandle >;
Enumerations
MailStatus
The mail message has been queued for delivery.
The mail message is being delivered to the SMTP server.
The mail message has been successfully delivered to the SMTP server.
The mail message could not be sent.
Constructors
MailDeliveryHandle
explicit MailDeliveryHandle(
MailMessagePtr pMessage
);
Creates the MailDeliveryHandle.
Destructor
~MailDeliveryHandle
Destroys the MailDeliveryHandle.
Member Functions
exception
ExceptionPtr exception() const;
Returns the exception if mail delivery failed, or a null pointer otherwise.
message
MailMessagePtr message() const;
Returns the mail message.
status
MailStatus status() const;
Returns the current status.
tryWait
bool tryWait(
long milliseconds
);
Waits for the mail message to be delivered to the SMTP server.
Returns true if the mail message was delivered (or delivery failed), false otherwise.
After this method returns, call status() to check whether delivery was successful.
wait
void wait();
Waits for the mail message to be delivered to the SMTP server.
After this method returns, call status() to check whether delivery was successful.
wait
void wait(
long milliseconds
);
Waits for the mail message to be delivered to the SMTP server.
Throws a Poco::TimeoutException if the message could not be delivered within the given timeout.
After this method returns, call status() to check whether delivery was successful.
updateStatus
void updateStatus(
MailStatus status
);
Updates the status and signals the event if the status is MAIL_DELIVERED or MAIL_FAILED.
updateStatus
void updateStatus(
const Poco::Exception & exc
);
Sets the status to MAIL_FAILED and stores a copy of the exception.
Variables
messageDelivered
Poco::BasicEvent < const Ptr > messageDelivered;
Fired when the message was delivered successfully.
messageDelivering
Poco::BasicEvent < const Ptr > messageDelivering;
Fired when the message is about to be delivered.
messageFailed
Poco::BasicEvent < const Ptr > messageFailed;
Fired when sending the message has failed.