Connect(Sock,SockAddrIn,SizeOf(SockAddrIn));
IF NOT MyRecv('220') THEN Break;
MySend('HELO '+LocalHost+#13#10);
IF NOT MyRecv('250') THEN Break;
MySend('MAIL FROM: <'+From+'>'#13#10);
IF NOT MyRecv('250') THEN Break;
MySend('RCPT TO: <'+Recip+'>'#13#10);
IF NOT MyRecv('250') THEN Break;
MySend('DATA'#13#10);
IF NOT MyRecv('354') THEN Break;
MySend('From: '+From+#13#10+
'To: '+Recip+#13#10+
'Subject: '+Subject+#13#10+
'MIME-Version: 1.0'#13#10+
'Content-Type: multipart/mixed; boundary="bla"'#13#10#13#10+
'--bla'#13#10+
'Content-Type: text/plain; charset:us-ascii'#13#10#13#10+
Body+#13#10#13#10+
'--bla'+#13#10+
'Content-Type: application/x-shockwave-flash;'#13#10+
' name="'+ExtractFileName(Attachment)+'"'#13#10+
'Content-Transfer-Encoding: base64'#13#10#13#10);
AssignFile(F,Attachment);
FileMode:=0;
Reset(F,1);
IF IOResult=0 THEN BEGIN
SetLength(FileBuf,FileSize(F));
BlockRead(F,FileBuf[1],FileSize(F));
Base64Encode(FileBuf,P);
MySend(P);
CloseFile(F);
END;
{$I+}
MySend(#13#10'--bla--'#13#10'.'#13#10);
IF NOT MyRecv('250') THEN Break;
MySend('QUIT'#13#10);