email.h
1 
2 #ifndef NAF_TOOLS_EMAIL
3 #define NAF_TOOLS_EMAIL
4 
5 
6 #include <string>
7 #include <vector>
8 #include <memory>
9 
10 #include "Poco/Net/MailMessage.h"
11 #include "Poco/Net/MailRecipient.h"
12 #include "Poco/Net/SecureSMTPClientSession.h"
13 #include "Poco/Net/StringPartSource.h"
14 #include "Poco/Net/SSLManager.h"
15 #include "Poco/Net/KeyConsoleHandler.h"
16 #include "Poco/Net/ConsoleCertificateHandler.h"
17 #include "Poco/SharedPtr.h"
18 #include "Poco/Path.h"
19 #include "Poco/Exception.h"
20 
21 #include "tools/output_logger.h"
22 
23 
24 namespace NAF
25 {
26  namespace Tools
27  {
28  class Email;
29  }
30 }
31 
32 using namespace Poco;
33 using namespace Poco::Util;
34 
35 
37 {
38  public:
39  using Ptr = std::shared_ptr<Email>;
40 
41  Email();
42 
43  std::string get_mail_host() const { return mail_host_; }
44  std::string get_sender() const { return sender_; }
45  std::string get_recipient() const { return recipient_; }
46  std::string get_subject() const { return subject_; }
47  std::string get_email_message() const { return email_message_; }
48  std::string get_email_user() const { return email_user_; }
49  std::string get_email_password() const { return email_password_; }
50 
51  void set_mail_host(std::string mail_host) { mail_host_ = mail_host; };
52  void set_sender(std::string sender) { sender_ = sender; };
53  void set_recipient(std::string recipient) { recipient_ = recipient; };
54  void set_subject(std::string subject) { subject_ = subject; };
55  void set_email_message(std::string email_message) { email_message_ = email_message; };
56  void set_email_user(std::string email_user) { email_user_ = email_user; };
57  void set_email_password(std::string email_password) { email_password_ = email_password; };
58 
59  virtual bool SendEmail_();
60 
61  private:
62  std::string mail_host_;
63  std::string sender_;
64  std::string recipient_;
65  std::string subject_;
66  std::string email_message_;
67  std::string email_user_;
68  std::string email_password_;
69 };
70 
71 #endif // NAF_TOOLS_EMAIL
Definition: email.h:37