summaryrefslogtreecommitdiff
path: root/src/message/builder/mail_to.cpp
blob: 342829cf451b7b194e6d5f80f5dad16eb4be6693 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include "mail_to.hpp"

namespace smtp::message::builder
{
    MailTo::MailTo( general::MailsSet const& mails )
        : mMailTo( mails )
    {

    }

    std::string MailTo::Get() const
    {
        std::string result;
        if( mBase )
        {
            result = mBase->Get();
        }

        result += "To: " + GetFirstMail() +"\r\n";

        return result;
    }

    std::string MailTo::GetFirstMail() const
    {
        return *mMailTo.begin();
    }
}