![]() |
![]() |
| Paypal | FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
|||||||
| Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Buscar | Temas de Hoy | Marcar Foros Como Leídos |
|
|
Herramientas | Buscar en Tema | Desplegado |
|
#3
|
|||
|
|||
|
Lo volvi a preguntar por que me daba un monton de errores
(creo que el fallo esta en las uses pero intento buscar con el "Find in Files..." del menú "Search" y me salen una burrada.... pero por si acaso, las meti todas; (manera bestia) y me sigue saliendo los mismos errores...). P.D.:Uso delphi 7, ¿sera por eso?. Os dejo los mensajes de error para que los veais: 1º el codigo... uses IdSmtp, IdMessage, procedure TForm1.Button1Click(Sender: TObject); begin with idMessage do begin // Cuerpo del mensaje. Body.Clear; Body.Add('Aqui añades el cuerpo del mensaje'); // Cuenta Origen. From.Text := EMAILORIGEN; // Cuenta Destino. Recipients.EMailAddresses := EMAILDESTINO; // Asunto del email. Subject := ASUNTO; // Prioridad del mensaje, ALTA. Priority := TidMessagePriority(mpHighest); // Coloco el archivo adjunto el cual enviar. TidAttachment.Create(idMensage.MessageParts,ARCHIVOADJUNTO); end; with idSMPT do begin // Configuro autentificación. AuthenticationType := atLogin; Username := USERNAME; // Nombre del usuario Password := PASS; // la password // Configuro el servidor SMTP. Host := HOST; Port := PUERTO; try Connect; try // Envio el mensaje. Send(idMenssage); finally Disconnect; end; Msg('Enviado Correctamente'); except // Capturo algunas excepciones que pueden ocurrir ON E: EIdProtocolReplyError do begin Msg('No se ha podido enviar el email.' + #13 + 'Incorrecto el email o el usuario o la password.'); end; on E: EFOpenError do begin Msg('No se ha podido enviar el email.' + #13 + 'Fichero Adjunto desconocido o erróneo.'); end; on E: EIdSocketError do begin Msg('No se ha podido enviar el email.'+ #13 + 'Host desconocido o incorrecto.'); end else begin Msg('Fallo en el envio de email'); end; end; if connected then Disconnect; end end. 2º Los errores: [Error] Unit1.pas(30): '.' expected but 'DO' found [Error] Unit1.pas(32): Undeclared identifier: 'Body' [Error] Unit1.pas(33): Missing operator or semicolon [Error] Unit1.pas(35): Missing operator or semicolon [Error] Unit1.pas(37): Undeclared identifier: 'Recipients' [Error] Unit1.pas(39): Undeclared identifier: 'Subject' [Error] Unit1.pas(41): Undeclared identifier: 'Priority' [Error] Unit1.pas(43): Undeclared identifier: 'idMensage' [Error] Unit1.pas(43): 'END' expected but ',' found [Error] Unit1.pas(45): Declaration expected but 'WITH' found [Error] Unit1.pas(47): Undeclared identifier: 'AuthenticationType' [Error] Unit1.pas(48): Undeclared identifier: 'Username' [Error] Unit1.pas(49): Undeclared identifier: 'Password' [Error] Unit1.pas(52): Undeclared identifier: 'Port' [Error] Unit1.pas(55): Undeclared identifier: 'Connect' [Error] Unit1.pas(58): Undeclared identifier: 'Send' [Error] Unit1.pas(60): Undeclared identifier: 'Disconnect' [Error] Unit1.pas(62): Invalid typecast [Error] Unit1.pas(65): Undeclared identifier: 'EIdProtocolReplyError' [Error] Unit1.pas(67): Invalid typecast [Error] Unit1.pas(71): Invalid typecast [Error] Unit1.pas(73): Undeclared identifier: 'EIdSocketError' [Error] Unit1.pas(75): Invalid typecast [Error] Unit1.pas(78): Invalid typecast [Error] Unit1.pas(81): Undeclared identifier: 'connected' Muchas gracias a todos los que habeis desperdiciado un poco de tiempo en mi... ![]() |
| Herramientas | Buscar en Tema |
| Desplegado | |
|
|
|