Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Internet
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Grupo de Teaming del ClubDelphi

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 13-11-2007
jesvill jesvill is offline
Registrado
 
Registrado: nov 2007
Posts: 1
Poder: 0
jesvill Va por buen camino
correo Smtp error

Hola a todos,

Soy novato en delphi y estoy intentando enviar correos desde una aplicación. He visto las herramientas y parece que todo está bien. A la hora de ejecutar el programa , da el siguiente error:
" socket error #10053 software caused Connection error" (no se puede conectar con el servidor)
El outlook funciona correctamente con el mismo puerto (25).
Tengo Delphi6 y Indy9

Estoy un poco perdido , no se que puede pasar. Adjunto código:

Código Delphi [-]

Unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons,idsmtp,IdMessage;
type
TForm1 = class(TForm)
BitBtn1: TBitBtn;
procedure BitBtn1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}

procedure TForm1.BitBtn1Click(Sender: TObject);
var
smtp : tidsmtp;
mail : TIdMessage;
begin
smtp:=tidsmtp.create(self);
mail:=TIdMessage.create(self);
with smtp do
begin
port:=25;
Host:='mihost';
userid:='xxxl@xxx.es';
Password:='xxxxx';
end;

with mail do
begin
recipients.add;
recipients[0].Name:='xxxxxxxxxx';
recipients[0].Address:='xxxxxxxx@xxxxx.com';
from.Name:='xxxxxxx';
from.Address:='xxxxxxx@xxxxx.es';
subject:='Prueba correo';
body.Text:='esto es una prueba de correo';
end;
try
SMTP.Connect; 
except
raise Exception.Create( 'Error al conectar con el servidor.' ); 
end;
screen.Cursor:=crdefault;
try
try
smtp.Send(mail);
showmessage('se envio con exito');
except
on e:exception do
showmessage('NO,no!!');
end;
finally
if smtp.Connected then
smtp.Disconnect;
end;
mail.Free;
smtp.free;
end;
end.

Última edición por dec fecha: 13-11-2007 a las 13:50:10.
Responder Con Cita
Respuesta



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Problema al enviar correo por SMTP newtron Internet 5 05-10-2007 13:09:41
Enviar correo con SMTP de GMAIL via INDY 10 (idSMTP) lpedrazzi Internet 4 31-12-2006 22:30:26
Un codigo fuente para Enviar correo por SMTP JXJ Internet 5 15-05-2006 13:25:09
Error de tipo 554 al enviar correo. acl_gandalf Internet 3 23-06-2005 17:11:58
Error al enviar mails mediante smtp, AUXILIO!!! Walterdf Internet 1 18-12-2003 17:58:55


La franja horaria es GMT +2. Ahora son las 13:09:57.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi