예제 #1
0
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 (".");
}
예제 #2
0
파일: MsgTree.cpp 프로젝트: dbremner/WinLib
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 ());
    }
}