MCPcopy Create free account
hub / github.com/alibaba/async_simple / build_request

Method build_request

demo_example/smtp/smtp_client.cpp:307–328  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

305 }
306
307 void build_request() {
308 std::ostream out(&request_);
309
310 out << "EHLO " << server_.server << "\r\n";
311 out << "AUTH LOGIN\r\n";
312 out << base64_encode(server_.user) << "\r\n";
313 out << base64_encode(server_.password) << "\r\n";
314 out << "MAIL FROM:<" << data_.from_email << ">\r\n";
315 for (auto to : data_.to_email)
316 out << "RCPT TO:<" << to << ">\r\n";
317 out << "DATA\r\n";
318 out << "FROM: " << data_.from_email << "\r\n";
319 for (auto to : data_.to_email)
320 out << "TO: " << to << "\r\n";
321 out << "SUBJECT: " << data_.subject << "\r\n";
322
323 build_smtp_content(out);
324 build_smtp_file(out);
325
326 out << "--async_simple--\r\n";
327 out << ".\r\n";
328 }
329
330 void close() {
331 asio::error_code ignore_ec;

Callers

nothing calls this directly

Calls 1

base64_encodeFunction · 0.85

Tested by

no test coverage detected