void Smtp::Message::Send (Socket & socket) { // From: required socket.SendLine (_from); // To: for (LineBreakingSeq lineSeq (_to); !lineSeq.AtEnd (); lineSeq.Advance ()) { socket.SendLine (lineSeq.GetLine ()); } // Subject: for (LineBreakingSeq lineSeq (_subject); !lineSeq.AtEnd (); lineSeq.Advance ()) { socket.SendLine (lineSeq.GetLine ()); } // Date: required; SmtpCurrentTime currentTime; std::string date = "Date: " + currentTime.GetString (); socket.SendLine (date); socket.SendLine (MimeVersion); // Body _body->Send (socket); // End message socket.SendLine ("."); }
void PlainTextPart::Send (Socket & socket) const { socket.SendLine ("Content-Type: text/plain;"); socket.SendLine ("\tcharset=\"iso-8859-2\""); socket.SendLine ("Content-Transfer-Encoding: 7bit"); socket.SendLine (); for (LineBreakingSeq lineSeq (_text); !lineSeq.AtEnd (); lineSeq.Advance ()) { socket.SendLine (lineSeq.GetLine ()); } }