|
#include <CSmtpConnect.h>

Public Member Functions | |
| CSmtpConnect () | |
| Default constructor. | |
| ~CSmtpConnect () | |
| Destructor. | |
| int | command (std::string cmd, bool encodeCommand=false, bool decodeResponse=false) |
| CStrings & | response () |
| The response from the server - makes sence after calling any command. | |
| void | cmd_login (std::string user, std::string password) |
| Logs in to the server host(). | |
| void | cmd_send () |
| Sends the message. | |
| void | cmd_quit () |
| Ends the SMTP session. | |
| virtual void | sendMessage () |
| Sends the message. | |
Static Public Member Functions | |
| static std::string | stripHtml (const std::string &html) |
| Strips HTML tags off the message, prepare the alternative text for an HTML message. | |
Protected Member Functions | |
| void | sendCommand (std::string cmd, bool encode=false) |
| Sends command using SMTP protocol. | |
| int | getResponse (bool decode=false) |
| Retrieves the server response after the command into internal CStrings buffer. | |
Static Protected Member Functions | |
| static std::string | mime (std::string s) |
| Mime-encodes the string. | |
| static std::string | unmime (std::string s) |
| Mime-decodes the string. | |
Sends an e-mail message using SMTP protocol. It uses CSocket class to establish the connection, and CBaseMailConnect to make the complete RFC 822 message.
| void sptk::CSmtpConnect::cmd_login | ( | std::string | user, | |
| std::string | password | |||
| ) |
Logs in to the server host().
| user | std::string, user name | |
| password | std::string, user password |
| void sptk::CSmtpConnect::cmd_send | ( | ) |
Sends the message.
Message is based on the information defined by the methods from CBaseMailConnect, and retrieves the server output. An alias for sendMessage().
| int sptk::CSmtpConnect::command | ( | std::string | cmd, | |
| bool | encodeCommand = false, |
|||
| bool | decodeResponse = false | |||
| ) |
Sends command using SMTP protocol and retrieve the server response. The response can be read then with response() method. The CRLF characters after the command are added automatically.
| cmd | std::string, SMTP protocol command | |
| encodeCommand | bool, encode the comand argument to Base64 or not | |
| decodeResponse | bool, decode the response from Base64 or not |
| int sptk::CSmtpConnect::getResponse | ( | bool | decode = false |
) | [protected] |
Retrieves the server response after the command into internal CStrings buffer.
The response can be read then with response() method.
| decode | bool, decode the response from Base64 or not |
| void sptk::CSmtpConnect::sendCommand | ( | std::string | cmd, | |
| bool | encode = false | |||
| ) | [protected] |
Sends command using SMTP protocol.
The CRLF characters after the command are added automatically.
| cmd | std::string, SMTP protocol command | |
| encode | bool, encode the arguments to Base64 or not |
| virtual void sptk::CSmtpConnect::sendMessage | ( | ) | [virtual] |
Sends the message.
The message based on the information defined by the methods from CBaseMailConnect, and retrieves the server output.
Implements sptk::CBaseMailConnect.
| static std::string sptk::CSmtpConnect::stripHtml | ( | const std::string & | html | ) | [static] |
Strips HTML tags off the message, prepare the alternative text for an HTML message.
| html | const std::string&, the HTML text |