KMime::Headers::Generics::MailboxList Class

class KMime::Headers::Generics::MailboxList

Base class for headers that deal with (possibly multiple) addresses, but don't allow groups. More...

Header: #include <KMime/Headers>
CMake: find_package(KPim6 REQUIRED COMPONENTS Mime)
target_link_libraries(mytarget PRIVATE KPim6::Mime)
Inherits: KMime::Headers::Generics::Structured
Inherited By:

KMime::Headers::From

Public Functions

void addAddress(const KMime::Types::Mailbox &mbox)
void addAddress(const QByteArray &address, const QString &displayName = QString())
QList<QByteArray> addresses() const
QStringList displayNames() const
QString displayString() const
QList<KMime::Types::Mailbox> mailboxes() const
(since 24.12) void setMailboxes(const QList<KMime::Types::Mailbox> &mailboxes)

Detailed Description

See RFC 2822, section 3.4

Member Function Documentation

void MailboxList::addAddress(const KMime::Types::Mailbox &mbox)

Adds an address to this header.

mbox A Mailbox object specifying the address.

void MailboxList::addAddress(const QByteArray &address, const QString &displayName = QString())

Adds an address to this header.

address The actual email address, with or without angle brackets.

displayName An optional name associated with the address.

QList<QByteArray> MailboxList::addresses() const

Returns a list of all addresses in this header, regardless of groups.

QStringList MailboxList::displayNames() const

Returns a list of all display names associated with the addresses in this header.

The address is added for addresses that do not have a display name.

QString MailboxList::displayString() const

Returns a single string for user-facing display of this mailbox list.

This is equivalent to displayNames().join(", ").

QList<KMime::Types::Mailbox> MailboxList::mailboxes() const

Returns a list of mailboxes listed in this header.

See also setMailboxes().

[since 24.12] void MailboxList::setMailboxes(const QList<KMime::Types::Mailbox> &mailboxes)

Sets the mailboxes listed in this header, replacing the current content.

This function was introduced in 24.12.

See also mailboxes().