Class: TMIMEMess
RFC: 2045, 2046, 2047, 2048, 2049
Features:
{you must create object for MIME message}
MIME:=TMIMEMess.Create;
try
{set headers for message}
MIME.header.from:=fromaddress;
MIME.header.Tolist.add(toaddress);
MIME.header.subject:=subject;
{add text part}
MIME.AddPartText(StringListWithText);
{add binary part}
MIME.AddPartBinary(FilenameWithBinary);
{compose message}
MIME.EncodeMessage;
MIME.FinalizeHeaders;
{Mime message done.}
{now we may send it to SMTP server... by SMTPSend unit...}
SendToRaw (fromaddress, toaddress, SMTPHost, MIME.Lines, '', '');
{destroy MIME object}
MIME.Free;
end;