Dependents: TimeZoneDemo EthernetJackTestCode MMEx_Challenge ntp_mem ... more
Diff: services/email/smtp/SMTPClient.cpp
- Revision:
- 6:d64fca63b94e
- Parent:
- 5:fa27dde97304
--- a/services/email/smtp/SMTPClient.cpp Sat Nov 27 23:23:43 2010 +0000 +++ b/services/email/smtp/SMTPClient.cpp Sun Nov 28 00:29:32 2010 +0000 @@ -70,19 +70,14 @@ } string SMTPClient::encodePlainAuth() { - string auth = "AUTH PLAIN "; string decStr = m_username; decStr += '\0'; decStr += m_username; decStr += '\0'; decStr += m_password; - char* out = new char[ (((decStr.length()-1)/3)+1)<<2 ]; - base64enc(decStr.c_str(), decStr.length(), out); - auth.append(string(out)); - delete[] out; - - return auth; + string auth = "AUTH PLAIN "; + return auth.append(Base64::encode(decStr)); } void SMTPClient::setHeloDomain(const char* heloDomain) {