Ya intentaste con los componentes Indy? Usa el TIdSMTP, seria algo así:
Código Delphi
[-]
procedure EnviarMensaje(Texto, RutaFile:String);
var
SMTP: TIdSMTP;
Mensaje: TIdMessage;
Adjunto: TIdAttachment;
begin
SMTP := TIdSMTP.Create(nil);
SMTP.Username := 'tucorreo@mail.com';
SMTP.Password := 'password';
SMTP.Host := 'host';
SMTP.Port := puertoaqui;
if NecesitaAuth then
SMTP.AuthType := satDefault
else
SMTP.AuthType := satNone;
if NecesitaSSL then
begin
SMTP.IOHandler:= IdSSLIOHandlerSocketOpenSSL1;
SMTP.UseTLS:= utUseExplicitTLS;
end;
Mensaje := TIdMessage.Create( nil );
Mensaje.Clear;
Mensaje.From.Address := 'tucorreo@mail.com';
Mensaje.Subject := 'Asunto';
Mensaje.Body.Text := Texto;
Mensaje.Recipients.EmailAddresses := 'correodestino@correo.com';
if FileExists( sAdjunto ) then
Adjunto := TIdAttachmentFile.Create(Mensaje.MessageParts, RutaFile )
else
Adjunto:= nil;
try
SMTP.Connect;
except
raise SysUtils.Exception.Create(lsMsj);
end;
if SMTP.Connected then
begin
try
SMTP.Send(Mensaje);
except
raise SysUtils.Exception.Create(lsMsj);
end;
try
SMTP.Disconnect;
except
raise SysUtils.Exception.Create( 'Error al desconectar del servidor.' );
end;
end;
FreeAndNil( Adjunto );
FreeAndNil( Mensaje );
FreeAndNil( SMTP );
end;