• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepimlibs API Reference
  • KDE Home
  • Contact Us
 

mailtransport

  • MailTransport
  • MessageQueueJob
Public Member Functions | Protected Slots | List of all members
MailTransport::MessageQueueJob Class Reference

#include <messagequeuejob.h>

Inherits KCompositeJob.

Public Member Functions

 MessageQueueJob (QObject *parent=0)
 
virtual ~MessageQueueJob ()
 
Akonadi::AddressAttribute & addressAttribute ()
 
DispatchModeAttribute & dispatchModeAttribute ()
 
KMime::Message::Ptr message () const
 
SentActionAttribute & sentActionAttribute ()
 
SentBehaviourAttribute & sentBehaviourAttribute ()
 
void setMessage (KMime::Message::Ptr message)
 
virtual void start ()
 
TransportAttribute & transportAttribute ()
 

Protected Slots

virtual void slotResult (KJob *)
 

Detailed Description

Provides an interface for sending email.

This class takes a KMime::Message and some related info such as sender and recipient addresses, and places the message in the outbox. The mail dispatcher agent will then take it from there and send it.

This is the preferred way for applications to send email.

This job requires some options to be set before being started. Modify the attributes of this job to change these options.

You need to set the transport of the transport attribute, the from address of the address attribute and one of the to, cc or bcc addresses of the address attribute. Also, you need to call setMessage(). Optionally, you can change the dispatch mode attribute or the sent behaviour attribute.

Example:

MessageQueueJob *job = new MessageQueueJob( this );
job->setMessage( msg ); // msg is a Message::Ptr
job->transportAttribute().setTransportId( TransportManager::self()->defaultTransportId() );
// Use the default dispatch mode.
// Use the default sent-behaviour.
job->addressAttribute().setFrom( from ); // from is a QString
job->addressAttribute().setTo( to ); // to is a QStringList
connect( job, SIGNAL(result(KJob*)), this, SLOT(jobResult(KJob*)) );
job->start();
See also
DispatchModeAttribute
SentActionAttribute
SentBehaviourAttribute
TransportAttribute
AddressAttribute
Author
Constantin Berzan exit3.nosp@m.219@.nosp@m.gmail.nosp@m..com
Since
4.4

Definition at line 86 of file messagequeuejob.h.

Constructor & Destructor Documentation

MessageQueueJob::MessageQueueJob ( QObject *  parent = 0)
explicit

Creates a new MessageQueueJob.

Parameters
parentthe QObject parent This is not an autostarting job; you need to call start() yourself.

Definition at line 160 of file messagequeuejob.cpp.

MessageQueueJob::~MessageQueueJob ( )
virtual

Destroys the MessageQueueJob.

This job deletes itself after finishing.

Definition at line 165 of file messagequeuejob.cpp.

Member Function Documentation

AddressAttribute & MessageQueueJob::addressAttribute ( )

Returns a reference to the address attribue for this message.

Modify the returned attribute to change the receivers or the from address.

Definition at line 180 of file messagequeuejob.cpp.

DispatchModeAttribute & MessageQueueJob::dispatchModeAttribute ( )

Returns a reference to the dispatch mode attribue for this message.

Modify the returned attribute to change the dispatch mode.

Definition at line 175 of file messagequeuejob.cpp.

Message::Ptr MessageQueueJob::message ( ) const

Returns the message to be sent.

Definition at line 170 of file messagequeuejob.cpp.

SentActionAttribute & MessageQueueJob::sentActionAttribute ( )

Returns a reference to the sent action attribue for this message.

Modify the returned attribute to change the sent actions.

Definition at line 195 of file messagequeuejob.cpp.

SentBehaviourAttribute & MessageQueueJob::sentBehaviourAttribute ( )

Returns a reference to the sent behaviour attribue for this message.

Modify the returned attribute to change the sent behaviour.

Definition at line 190 of file messagequeuejob.cpp.

void MessageQueueJob::setMessage ( KMime::Message::Ptr  message)

Sets the message to be sent.

Definition at line 200 of file messagequeuejob.cpp.

void MessageQueueJob::slotResult ( KJob *  job)
protectedvirtualslot

Called when the ItemCreateJob subjob finishes.

(reimplemented from KCompositeJob)

Definition at line 213 of file messagequeuejob.cpp.

void MessageQueueJob::start ( )
virtual

Creates the item and places it in the outbox.

It is now queued for sending by the mail dispatcher agent.

Definition at line 205 of file messagequeuejob.cpp.

TransportAttribute & MessageQueueJob::transportAttribute ( )

Returns a reference to the transport attribue for this message.

Modify the returned attribute to change the transport used for sending the mail.

Definition at line 185 of file messagequeuejob.cpp.


The documentation for this class was generated from the following files:
  • messagequeuejob.h
  • messagequeuejob.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:37:49 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

mailtransport

Skip menu "mailtransport"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • Related Pages

kdepimlibs API Reference

Skip menu "kdepimlibs API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal