join 1.0
lightweight network framework library
Loading...
Searching...
No Matches
join::SmtpMessage Class Reference

mail message. More...

#include <smtp_message.hpp>

Collaboration diagram for join::SmtpMessage:

Public Member Functions

 SmtpMessage ()=default
 create the SmtpMessage instance.
 
 SmtpMessage (const SmtpMessage &other)
 create the SmtpMessage instance by copy.
 
SmtpMessageoperator= (const SmtpMessage &other)
 assign the SmtpMessage instance by copy.
 
 SmtpMessage (SmtpMessage &&other)
 create the SmtpMessage instance by move.
 
SmtpMessageoperator= (SmtpMessage &&other)
 assign the SmtpMessage instance by move.
 
virtual ~SmtpMessage ()=default
 destroy the SmtpMessage instance.
 
void sender (const SmtpSender &from)
 set mail sender.
 
const SmtpSendersender () const
 get mail sender
 
void addRecipient (const SmtpRecipient &to)
 add mail recipient.
 
void addRecipient (SmtpRecipient &&to)
 add mail recipient.
 
const SmtpRecipientsrecipients () const
 get mail recipients.
 
void subject (const std::string &subj)
 set mail subject.
 
const std::string & subject () const
 get mail subject.
 
void content (const std::string &message)
 set mail content.
 
const std::string & content () const
 get mail content.
 
int writeHeaders (std::ostream &out) const
 write header to the given output stream.
 
int writeContent (std::ostream &out) const
 write content to the given output stream.
 

Protected Attributes

SmtpSender _sender
 mail sender.
 
SmtpRecipients _recipients
 mail recipients.
 
std::string _subject
 mail sender.
 
std::string _content
 mail content.
 

Detailed Description

mail message.

Constructor & Destructor Documentation

◆ SmtpMessage() [1/3]

join::SmtpMessage::SmtpMessage ( )
default

create the SmtpMessage instance.

◆ SmtpMessage() [2/3]

SmtpMessage::SmtpMessage ( const SmtpMessage & other)

create the SmtpMessage instance by copy.

Parameters
otherrequest to copy.

◆ SmtpMessage() [3/3]

SmtpMessage::SmtpMessage ( SmtpMessage && other)

create the SmtpMessage instance by move.

Parameters
otherrequest to move.

◆ ~SmtpMessage()

virtual join::SmtpMessage::~SmtpMessage ( )
virtualdefault

destroy the SmtpMessage instance.

Member Function Documentation

◆ addRecipient() [1/2]

void SmtpMessage::addRecipient ( const SmtpRecipient & to)

add mail recipient.

Parameters
tomail recipient.

◆ addRecipient() [2/2]

void SmtpMessage::addRecipient ( SmtpRecipient && to)

add mail recipient.

Parameters
tomail recipient.

◆ content() [1/2]

const std::string & SmtpMessage::content ( ) const

get mail content.

Returns
mail content.

◆ content() [2/2]

void SmtpMessage::content ( const std::string & message)

set mail content.

Parameters
messagemail content.

◆ operator=() [1/2]

SmtpMessage & SmtpMessage::operator= ( const SmtpMessage & other)

assign the SmtpMessage instance by copy.

Parameters
otherrequest to copy.
Returns
a reference of the current object.

◆ operator=() [2/2]

SmtpMessage & SmtpMessage::operator= ( SmtpMessage && other)

assign the SmtpMessage instance by move.

Parameters
otherrequest to move.
Returns
a reference of the current object.

◆ recipients()

const SmtpRecipients & SmtpMessage::recipients ( ) const

get mail recipients.

Returns
mail recipients.

◆ sender() [1/2]

const SmtpSender & SmtpMessage::sender ( ) const

get mail sender

Returns
mail sender.

◆ sender() [2/2]

void SmtpMessage::sender ( const SmtpSender & from)

set mail sender.

Parameters
frommail sender.

◆ subject() [1/2]

const std::string & SmtpMessage::subject ( ) const

get mail subject.

Returns
mail subject.

◆ subject() [2/2]

void SmtpMessage::subject ( const std::string & subj)

set mail subject.

Parameters
subjmail subject.

◆ writeContent()

int SmtpMessage::writeContent ( std::ostream & out) const

write content to the given output stream.

Parameters
outoutput stream.
Returns
0 on success, -1 on failure.

◆ writeHeaders()

int SmtpMessage::writeHeaders ( std::ostream & out) const

write header to the given output stream.

Parameters
outoutput stream.
Returns
0 on success, -1 on failure.

Member Data Documentation

◆ _content

std::string join::SmtpMessage::_content
protected

mail content.

◆ _recipients

SmtpRecipients join::SmtpMessage::_recipients
protected

mail recipients.

◆ _sender

SmtpSender join::SmtpMessage::_sender
protected

mail sender.

◆ _subject

std::string join::SmtpMessage::_subject
protected

mail sender.


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