#include <curl.hpp>
Inherits boost::noncopyable.
|
using | recipients_t = std::list< std::string > |
|
using | failures_t = std::vector< std::tuple< std::string, std::string > > |
|
|
| curl (std::string const &smtp_url, unsigned short port, std::string const &username, std::string const &password, bool enable_logging, bool enable_ssl_verification=false) noexcept(false) |
|
| ~curl () noexcept(true) |
|
void | from (std::string const &from) noexcept(true) |
|
failures_t | send (std::string const &subject, std::string const &body, recipients_t const &recipients) noexcept(false) |
|
|
std::ostream & | operator<< (std::ostream &os, curl const &c) noexcept(false) |
|
Curl tutorial.
Definition at line 38 of file curl.hpp.
◆ failures_t
◆ recipients_t
◆ curl()
jmmcg::LIBJMMCG_VER_NAMESPACE::curl::curl |
( |
std::string const & |
smtp_url, |
|
|
unsigned short |
port, |
|
|
std::string const & |
username, |
|
|
std::string const & |
password, |
|
|
bool |
enable_logging, |
|
|
bool |
enable_ssl_verification = false |
|
) |
| |
|
noexcept |
- Parameters
-
smtp_url | The hostname:port to which the email should be sent. |
Definition at line 70 of file curl.cpp.
◆ ~curl()
jmmcg::LIBJMMCG_VER_NAMESPACE::curl::~curl |
( |
| ) |
|
|
noexcept |
◆ from()
void jmmcg::LIBJMMCG_VER_NAMESPACE::curl::from |
( |
std::string const & |
from | ) |
|
|
noexcept |
Note that this option isn't strictly required, omitting it will result in libcurl sending the MAIL FROM command with empty sender data. All autoresponses should have an empty reverse-path, and should be directed to the address in the reverse-path which triggered them. Otherwise, they could cause an endless loop. See RFC 5321 Section 4.5.5 for more details.
Definition at line 109 of file curl.cpp.
◆ send()
curl::failures_t jmmcg::LIBJMMCG_VER_NAMESPACE::curl::send |
( |
std::string const & |
subject, |
|
|
std::string const & |
body, |
|
|
recipients_t const & |
recipients |
|
) |
| |
|
noexcept |
We're using a callback function to specify the payload (the headers and body of the message). You could just use the CURLOPT_READDATA option to specify a FILE pointer to read from.
Definition at line 134 of file curl.cpp.
◆ operator<<
std::ostream& operator<< |
( |
std::ostream & |
os, |
|
|
curl const & |
c |
|
) |
| |
|
friend |
The documentation for this class was generated from the following files: