Pages
API Documentation
On this page

KEMailClientLauncherJob Class

KEMailClientLauncherJob starts a mail client in order to compose a new mail. More...

  • Header: #include <KEMailClientLauncherJob>
  • CMake: find_package(KF6 REQUIRED COMPONENTS KIO)
    target_link_libraries(mytarget PRIVATE KIOGui)
  • Inherits: KJob

List of all members, including inherited members

Public Functions

Detailed Description

It creates a startup notification and finishes it on success or on error (for the taskbar). It also emits an error message if necessary (e.g. "program not found").

The job finishes when the application is successfully started. For error handling, either connect to the result() signal, or for a simple messagebox on error, you can do

job->setUiDelegate(new KDialogJobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, this));

Member Function Documentation

[explicit] KEMailClientLauncherJob::KEMailClientLauncherJob(QObject *parent = nullptr)

Creates a KEMailClientLauncherJob.

parent the parent QObject

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

Destructor

Note that jobs auto-delete themselves after emitting result

void KEMailClientLauncherJob::setAttachments(const QList<QUrl> &urls)

Sets attachments for the email

urls URLs of the attachments for the email

Remember to use QUrl::fromLocalFile() to construct those URLs from local file paths.

void KEMailClientLauncherJob::setBcc(const QStringList &bcc)

Sets the email address(es) that will be used in the Bcc field for the email

bcc recipients; each entry can use the format "" or "John Doe <>"

void KEMailClientLauncherJob::setBody(const QString &body)

Sets the body for the email

body the email body

void KEMailClientLauncherJob::setCc(const QStringList &cc)

Sets the email address(es) that will be used in the CC field for the email

cc recipients; each entry can use the format "" or "John Doe <>"

void KEMailClientLauncherJob::setStartupId(const QByteArray &startupId)

Sets the platform-specific startup id of the mail client launch.

startupId startup id, if any (otherwise "").

For X11, this would be the id for the Startup Notification protocol.

void KEMailClientLauncherJob::setSubject(const QString &subject)

Sets the subject for the email

subject the email subject

void KEMailClientLauncherJob::setTo(const QStringList &to)

Sets the email address(es) that will be used in the To field for the email

to recipients; each entry can use the format "" or "John Doe <>"

[override virtual] void KEMailClientLauncherJob::start()

Reimplements: KJob::start().

Starts the job.

You must call this, after having called all the necessary setters.

We use cookies to personalize content and to analyze our traffic. Please decide if you are willing to accept cookies from our website.