ArtPortEsp
19-12-2018, 18:36:29
No puedo usar la opcion de Busqueda del Foro para verificar si ya hay algun post de esto.... de antemano una disculpa si ya se ha tratado el tema
Estoy tratando de enviar correos desde mi aplicacion de Delphi 7 (cosa que ya habia logrado anteriormente), pero ahora estoy obteniendo un error que no me da mucha informacion para corregirlo....
el codigo es:
ListBox2.Items.clear;
eMessage.Body.Assign(Etexto.Lines);
eMessage.From.Text := Ede.text;
eMessage.Recipients.Clear;
x:= epara.text;
If Ansipos(';',x) > 0 Then
begin
While Ansipos(';',x) > 0 Do
Begin
eMessage.Recipients.Add.Address:=Copy(x,1,Ansipos(';',x)-1);
x:=Copy(x,Ansipos(';',x)+1,999);
End; { while }
eMessage.Recipients.Add.Address:=x;
end
else
eMessage.Recipients.Add.Address:=Epara.Text;
eMessage.Subject := easunto.Text;
IF Efile.FileName <> '' then TIdAttachmentFile.Create(eMessage.MessageParts,Efile.FileName);
Emessage.Priority := TidmessagePriority(mpHighest);
if Gauth='N' then
SMTP.AuthType := atNone
Else
SMTP.AuthType := atDefault;
SMTP.Username := Gcuenta;
SMTP.Password := Gpassword;
SMTP.Host := Gserver;
SMTP.Port := Strtointdef(Gpuerto,0);
if GemailSSL then
begin
IdSSLOpenSSLHeaders.Load;
//IdOpenSSLSetLibPath(Grutaexe);
SMTP.IOHandler := IdSSLIOHandlerSocketOpenSSL1;
IdSSLIOHandlerSocketOpenSSL1.SSLOptions.Method := sslvSSLv23;
IdSSLIOHandlerSocketOpenSSL1.SSLOptions.Mode := sslmUnassigned;
end;
SMTP.Disconnect;
SMTP.Connect;
if SMTP.Connected then
begin
Try
begin
if Fcorreo.tag <> 7 then
begin
SMTP.Send(Emessage);
DM.Bitacora('Correo','Envio de correo electronico', '',' Destinatario ('+Epara.text+')');
if listbox1.Items.Count > 0 then MessageDlg('El correo y sus adjuntos fueron enviados correctamente',mtInformation,[mbOk],0)
else MessageDlg('El correo fue enviado correctamente',mtInformation,[mbOk],0);
//DeleteFile(Efile.FileName);
end
else
Fcorreo.Tag := 0;
end
finally
SMTP.Disconnect;
END;
Close;
end
else
MessageDlg('No fue posible conectar con el servidor de correos.', mtWarning, [mbOK], 0);
y el error que estoy obteniendo es:
Project xxxxxxx raised exception class EIdSMTPReplyError with message ''
Any ideas?
btw i got the error in this line :
SMTP.Send(Emessage);
Estoy tratando de enviar correos desde mi aplicacion de Delphi 7 (cosa que ya habia logrado anteriormente), pero ahora estoy obteniendo un error que no me da mucha informacion para corregirlo....
el codigo es:
ListBox2.Items.clear;
eMessage.Body.Assign(Etexto.Lines);
eMessage.From.Text := Ede.text;
eMessage.Recipients.Clear;
x:= epara.text;
If Ansipos(';',x) > 0 Then
begin
While Ansipos(';',x) > 0 Do
Begin
eMessage.Recipients.Add.Address:=Copy(x,1,Ansipos(';',x)-1);
x:=Copy(x,Ansipos(';',x)+1,999);
End; { while }
eMessage.Recipients.Add.Address:=x;
end
else
eMessage.Recipients.Add.Address:=Epara.Text;
eMessage.Subject := easunto.Text;
IF Efile.FileName <> '' then TIdAttachmentFile.Create(eMessage.MessageParts,Efile.FileName);
Emessage.Priority := TidmessagePriority(mpHighest);
if Gauth='N' then
SMTP.AuthType := atNone
Else
SMTP.AuthType := atDefault;
SMTP.Username := Gcuenta;
SMTP.Password := Gpassword;
SMTP.Host := Gserver;
SMTP.Port := Strtointdef(Gpuerto,0);
if GemailSSL then
begin
IdSSLOpenSSLHeaders.Load;
//IdOpenSSLSetLibPath(Grutaexe);
SMTP.IOHandler := IdSSLIOHandlerSocketOpenSSL1;
IdSSLIOHandlerSocketOpenSSL1.SSLOptions.Method := sslvSSLv23;
IdSSLIOHandlerSocketOpenSSL1.SSLOptions.Mode := sslmUnassigned;
end;
SMTP.Disconnect;
SMTP.Connect;
if SMTP.Connected then
begin
Try
begin
if Fcorreo.tag <> 7 then
begin
SMTP.Send(Emessage);
DM.Bitacora('Correo','Envio de correo electronico', '',' Destinatario ('+Epara.text+')');
if listbox1.Items.Count > 0 then MessageDlg('El correo y sus adjuntos fueron enviados correctamente',mtInformation,[mbOk],0)
else MessageDlg('El correo fue enviado correctamente',mtInformation,[mbOk],0);
//DeleteFile(Efile.FileName);
end
else
Fcorreo.Tag := 0;
end
finally
SMTP.Disconnect;
END;
Close;
end
else
MessageDlg('No fue posible conectar con el servidor de correos.', mtWarning, [mbOK], 0);
y el error que estoy obteniendo es:
Project xxxxxxx raised exception class EIdSMTPReplyError with message ''
Any ideas?
btw i got the error in this line :
SMTP.Send(Emessage);