Class Poco::Net::MailRecipient
Author: Applied Informatics Software Engineering GmbH and Contributors

# Poco::Net

# class MailRecipient

Library: Net
Package: Mail
Header: Poco/Net/MailRecipient.h

## Description

The recipient of an e-mail message.

A recipient has a type (primary recipient, carbon-copy recipient, blind-carbon-copy recipient), an e-mail address and an optional real name.

## Member Summary

Member Functions: getAddress, getRealName, getType, operator =, setAddress, setRealName, setType, swap

## Enumerations

### RecipientType

PRIMARY_RECIPIENT

CC_RECIPIENT

BCC_RECIPIENT

## Constructors

### MailRecipient

MailRecipient();

Creates an empty MailRecipient.

### MailRecipient

MailRecipient(
const MailRecipient & recipient
);

Creates a MailRecipient by copying another one.

### MailRecipient

MailRecipient(
RecipientType type,
const std::string & address
);

Creates a MailRecipient of the given type.

### MailRecipient

MailRecipient(
RecipientType type,
const std::string & address,
const std::string & realName
);

Creates a MailRecipient of the given type.

## Destructor

### ~MailRecipient

~MailRecipient();

Destroys the MailRecipient.

## Member Functions

### getAddress

const std::string & getAddress() const;

Returns the address of the recipient.

### getRealName

const std::string & getRealName() const;

Returns the real name of the recipient.

### getType

RecipientType getType() const;

Returns the type of the recipient.

### operator =

MailRecipient & operator = (
const MailRecipient & recipient
);

Assigns another recipient.

### setAddress

void setAddress(
const std::string & address
);

Sets the address of the recipient.

### setRealName

void setRealName(
const std::string & realName
);

Sets the real name of the recipient.

### setType

void setType(
RecipientType type
);

Sets the type of the recipient.

### swap

void swap(
MailRecipient & recipient
);

Exchanges the content of two recipients.