NAWA 0.9
Web Application Framework for C++
nawa::mail::Email Class Referenceabstract

#include <nawa/mail/Email/Email.h>

Inherited by nawa::mail::MimeEmail, and nawa::mail::SimpleEmail.

Public Types

using HeadersMap = std::unordered_map< std::string, std::string >
 

Public Member Functions

virtual ~Email ()
 
 Email ()
 
 Email (Email const &other)
 
Emailoperator= (const Email &other)
 
 Email (Email &&other) noexcept
 
Emailoperator= (Email &&other) noexcept
 
HeadersMapheaders () noexcept
 
HeadersMap const & headers () const noexcept
 
Emailheaders (HeadersMap value) noexcept
 
virtual std::string getRaw (std::shared_ptr< ReplacementRules > const &replacementRules) const =0
 

Detailed Description

Base structure for emails. To create an email, use the SimpleEmail or MimeEmail class.

Definition at line 44 of file Email.h.

Member Typedef Documentation

◆ HeadersMap

using nawa::mail::Email::HeadersMap = std::unordered_map<std::string, std::string>

Definition at line 60 of file Email.h.

Constructor & Destructor Documentation

◆ ~Email()

virtual nawa::mail::Email::~Email ( )
virtual

◆ Email() [1/3]

nawa::mail::Email::Email ( )

◆ Email() [2/3]

nawa::mail::Email::Email ( Email const &  other)

◆ Email() [3/3]

nawa::mail::Email::Email ( Email &&  other)
noexcept

Member Function Documentation

◆ operator=() [1/2]

Email & nawa::mail::Email::operator= ( const Email other)

◆ operator=() [2/2]

Email & nawa::mail::Email::operator= ( Email &&  other)
noexcept

◆ headers() [1/3]

HeadersMap & nawa::mail::Email::headers ( )
noexcept

Map to save the mail headers in (case-sensitive). Headers From and Date are mandatory and must be set automatically by the mail function if not specified in this map. Other fields that should be considered are: To, Subject, Cc, Content-Type (will be set automatically by MimeEmail). This map is designed to be accessed by the mail function in order to complete it, if necessary. The toRaw() method might as well include other headers.

The email function is not obliged to (and should not) do any escaping in the headers. The application creating the email is responsible for ensuring their validity.

Returns
Reference to element.

◆ headers() [2/3]

HeadersMap const & nawa::mail::Email::headers ( ) const
noexcept

◆ headers() [3/3]

Email & nawa::mail::Email::headers ( HeadersMap  value)
noexcept

◆ getRaw()

virtual std::string nawa::mail::Email::getRaw ( std::shared_ptr< ReplacementRules > const &  replacementRules) const
pure virtual

This method shall generate the raw source of the email (including headers).

Parameters
replacementRulesReplacements that shall be applied in all suitable (body) parts of the email.
Returns
Raw source of the email.

Implemented in nawa::mail::MimeEmail, and nawa::mail::SimpleEmail.


The documentation for this class was generated from the following file: