diff options
Diffstat (limited to 'src/mail.cpp')
-rw-r--r-- | src/mail.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/mail.cpp b/src/mail.cpp index 84e1210..0c868d2 100644 --- a/src/mail.cpp +++ b/src/mail.cpp @@ -29,11 +29,25 @@ void mailer::send( ) } if( !body.empty( ) ) { - quickmail_add_body_memory( mailobj, "plain/text", const_cast<char *>( body.c_str( ) ), body.size( ), 0 ); + quickmail_add_body_memory( mailobj, "text/plain", const_cast<char *>( body.c_str( ) ), body.size( ), 0 ); } + _hasError = false; const char *errmsg; errmsg = quickmail_send( mailobj, server.c_str( ), port, username.c_str( ), password.c_str( ) ); - std::cerr << "ERROR: " << errmsg << std::endl; + if( errmsg != NULL ) { + _hasError = true; + lastErrorMsg = std::string( errmsg ); + } +} + +bool mailer::hasError( ) +{ + return _hasError; +} + +std::string mailer::getLastError( ) +{ + return lastErrorMsg; } |