MailTransport::TransportJob Class

class MailTransport::TransportJob

Abstract base class for all mail transport jobs. More...

Header: #include <MailTransport/TransportJob>
CMake: find_package(KPim6MailTransport REQUIRED)
target_link_libraries(mytarget PRIVATE KPim6::MailTransport)
Inherits: KCompositeJob
Status: Deprecated

This class is deprecated. We strongly advise against using it in new code.

Public Functions

virtual ~TransportJob() override
void setBcc(const QStringList &bcc)
void setCc(const QStringList &cc)
void setData(const QByteArray &data)
void setDeliveryStatusNotification(bool enabled)
void setSender(const QString &sender)
void setTo(const QStringList &to)
MailTransport::Transport *transport() const

Reimplemented Public Functions

virtual void start() override

Protected Functions

TransportJob(MailTransport::Transport *transport, QObject *parent = nullptr)
QStringList bcc() const
QBuffer *buffer()
QStringList cc() const
QByteArray data() const
bool deliveryStatusNotification() const
virtual void doStart() = 0
QString sender() const
QStringList to() const

Detailed Description

This is a job that is supposed to send exactly one mail.

Use Akonadi::MessageQueueJob from akonadi-mime for sending e-mail.

Member Function Documentation

[explicit protected] TransportJob::TransportJob(MailTransport::Transport *transport, QObject *parent = nullptr)

Creates a new mail transport job. transport The transport configuration. This must be a deep copy of a Transport object, the job takes the ownership of this object. parent The parent object.

See also TransportManager::createTransportJob().

[override virtual noexcept] TransportJob::~TransportJob()

Deletes this transport job.

[protected] QStringList TransportJob::bcc() const

Returns the "Bcc" receiver(s) of the mail.

See also setBcc().

[protected] QBuffer *TransportJob::buffer()

Returns a QBuffer opened on the message data. This is useful for processing the data in smaller chunks.

[protected] QStringList TransportJob::cc() const

Returns the "Cc" receiver(s) of the mail.

See also setCc().

[protected] QByteArray TransportJob::data() const

Returns the data of the mail.

See also setData().

[protected] bool TransportJob::deliveryStatusNotification() const

Returns true if DSN is enabled.

See also setDeliveryStatusNotification().

[pure virtual protected] void TransportJob::doStart()

Do the actual work, implement in your subclass.

[protected] QString TransportJob::sender() const

Returns the sender of the mail.

See also setSender().

void TransportJob::setBcc(const QStringList &bcc)

Sets the "Bcc" receiver(s) of the mail. bcc must be the plain email address(es), not including display name.

See also bcc().

void TransportJob::setCc(const QStringList &cc)

Sets the "Cc" receiver(s) of the mail. cc must be the plain email address(es), not including display name.

See also cc().

void TransportJob::setData(const QByteArray &data)

Sets the content of the mail to data.

See also data().

void TransportJob::setDeliveryStatusNotification(bool enabled)

Sets whether a delivery status notification is requested, according to enabled.

See also deliveryStatusNotification().

void TransportJob::setSender(const QString &sender)

Sets the sender of the mail. sender must be the plain email address, not including display name.

See also sender().

void TransportJob::setTo(const QStringList &to)

Sets the "To" receiver(s) of the mail. to must be the plain email address(es), not including display name.

See also to().

[override virtual] void TransportJob::start()

Reimplements: KJob::start().

Starts this job. It is recommended to not call this method directly but use TransportManager::schedule() to execute the job instead.

See also TransportManager::schedule().

[protected] QStringList TransportJob::to() const

Returns the "To" receiver(s) of the mail.

See also setTo().

MailTransport::Transport *TransportJob::transport() const

Returns the Transport object containing the mail transport settings.