blob: 11afd6f711778d41f1b39eb2f6f210160d0f3047 (
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
29
30
31
32
33
34
35
36
37
38
|
#pragma once
#include <list>
#include <memory>
#include <curl/curl.h>
#include "managment/settings.hpp"
#include "managment/mail.hpp"
namespace smtp::message
{
struct WriteThis
{
int counter;
};
class Sender
{
public:
Sender( manage::Settings const& settings_storage, manage::Mail const& mail_to );
~Sender() = default;
bool Send( std::string const& mail_from, std::string const& subject, std::string const& text );
private:
void UpdateMailText( std::string const& mail_from, std::string const& subject, std::string const& textt ) const;
void InitSenders( std::string const& mail_from, std::list<std::string> const& mail_to );
void FillRecipients(CURL* curl, curl_slist* recipients );
std::string GetHostPortData() const;
static size_t ReadCallBack( void *ptr, size_t size, size_t nmemb, void *userp );
manage::Settings const& mSettingsStorage;
manage::Mail const& mMailTo;
bool InitCurl( CURL* curl, WriteThis const& upload_ctx, std::string const& mail_from );
};
}
|