Aquí tengo lo que he formado pero me da un error y es el siguiente.
Cuando le doy a enviar la primera vez sale todo perfecto, pero si cambio la dirección de correo para enviarselo a otro, entonces me sale el error de EidProtocolReplyError 553 RCPT REFUSED.
Aquí tienen el codigo
Código Delphi
[-]
procedure EnviarHtml(aText: String;ruta,destino:string;aImagenes:array of string);
var
idAttach: TidAttachment;
idText1: TidText;
idText2: TidText;
p: TidMessageParts;
idMessage1: TidMessage;
slBody: TStringList;
idSMTP1: TidSMTP;
x:integer;
begin
idMessage1 := TIdMessage.create(nil);
idMessage1.Recipients.Add;
idMessage1.Recipients[0].Address := destino;
idMessage1.subject := 'OFERTAS';
p := idMessage1.MessageParts;
slBody := TstringList.Create;
try
try
idSMTP1 := TidSMTP.create(nil);
idSMTP1.AuthenticationType :=atLogin;
idSMTP1.Port := 25;
idSMTP1.Host := 'smtp.ono.com';
idSMTP1.UserId :='upimolina@ono.com';
idSMTP1.Password := 'OLIMPICO';
slBody.Add(atext);
idText1 := TidText.Create(p, slBody);
idText1.ContentType := 'text/html';
idText2 := TidText.Create(p);
idText2.ContentType := 'text/plain';
idText2.Body.Text := '';
for x := 0 to 3 do
begin
if (length(aImagenes[x]) > 0) then
begin
idAttach := TidAttachment.Create(p, ruta+aImagenes[x]);
idAttach.ContentType := 'image/jpeg';
idAttach.ContentDisposition := 'inline';
idAttach.ExtraHeaders.Values['content-id'] := aImagenes[x];
idMessage1.Body.Assign(slBody);
idAttach.DisplayName := aImagenes[x];
idMessage1.ContentType := 'multipart/mixed';
end;
end;
idSMTP1.Connect;
idSMTP1.Send(idMessage1);
finally
idSMTP1.Disconnect;
idMessage1.Free;
slBody.Free;
Showmessage('enviado');
end;
except
showmessage('Error al enviar el e-mail, consulte con su administrador.');
end;
end;
Haber si alguién me puede decir a que se debe ese motivo y tener en cuenta que todavía lo estoy depurando, gracias.