Ver Mensaje Individual
  #1  
Antiguo 15-06-2010
Avatar de richy08
richy08 richy08 is offline
Miembro
 
Registrado: may 2007
Ubicación: Bucerias, Nayarit Mexico
Posts: 529
Reputación: 18
richy08 Va por buen camino
Enviar correo desde delphi con TIdSMTP y TIdMessage

buenas tardes compañeros tengo un problema y por mas que le busco no doy con el clavo, tengo una aplicacion que despues de terminar algunos procesos envio los estados en los que quedo dicha aplicacion, pero algo raro sucede ya que los correos llegan sin problemas a xxxxx@hotmail.com pero al contrario al querer mandar dicho correo al dominio del lciente para la cual fue diseñada nunca llegan y al parecer los envia sin problemas, cabe mencionar que para pruebas he estado usando tres dominios diferentes el de hotmail, el de la empresa y el del cliente este es el codigo que utilizo alguna idea del por que no lo hace mil gracias.

Código Delphi [-]
 smtp := TIdSMTP.Create(Self);
      mail := TIdMessage.Create(Self);
      cad:='';
      with smtp do
      begin
        Qry_correo.Close;
        Qry_correo.open;
        Port:=Qry_correo.fieldbyname('port').Value;
        Host:=Qry_correo.fieldbyname('host').Value;
        Username:=Qry_correo.fieldbyname('userm').Value;
        Password:=Qry_correo.fieldbyname('passwordm').Value;
      end;
     
      with mail do
      begin
        Recipients.Add;
        Recipients[0].Name   :='SitiSystems';
        Recipients.EmailAddresses:='rarellano@sitixxxxxxx.net'
        From.Name            :='PMS';
        From.Address         :='nightaudit_imanta@sitixxxxxxx.net';
        Subject              :='Night Audit Proccess';

        Qry_NightAuditCorreo.Close;
           Qry_NightAuditCorreo.Parameters.ParamByName('id').Value:=SP_NightAuditCon.Parameters.ParamValues['@estado'];
        Qry_NightAuditCorreo.Open;

        if Qry_NightAuditCorreo.Fields.FieldByNumber(3).Value='Y' then
            cad:=cad+'Exchange rate successfully'+'  '+#13+#10
        else
            cad:=cad+'Exchange rate failure'+'  '+#13+#10;

        if Qry_NightAuditCorreo.Fields.FieldByNumber(4).Value='Y' then
            cad:=cad+'Itinerary successfully'+'  '+#13+#10
        else
            cad:=cad+'Itinerary failure'+'  '+#13+#10;

        if Qry_NightAuditCorreo.Fields.FieldByNumber(5).Value='Y' then
           cad:=cad+'Interface aldelo successfully'+#13+#10
        else
            cad:=cad+'Interface aldelo failure'+#13+#10;

         if Qry_NightAuditCorreo.Fields.FieldByNumber(6).Value='Y' then
            cad:=cad+'Interface PBX successfully'+' '+#13+#10
        else
            cad:=cad+'Interface PBX failure'+' '+#13+#10;

        if Qry_NightAuditCorreo.Fields.FieldByNumber(7).Value='Y' then
            cad:=cad+'Audit Reservations successfully'+' '+#13+#10
        else
           cad:=cad+'Audit Reservations failure'+' '+#13+#10;

        if Qry_NightAuditCorreo.Fields.FieldByNumber(8).Value='Y' then
            cad:=cad+'Audit Huepsed successfully'+' '+#13+#10
        else
            cad:=cad+'Audit Huesped failure'+' '+#13+#10;

       Body.Text:=cad;
      end;

      try
        smtp.Connect;
      except
        ShowMessage('Ocurred an Error, The Message was not Sent');
      end;
        Screen.Cursor:=CrDefault;

      try
        smtp.Send(mail);
      except
      //on E: Exception do
        ShowMessage('The Message was not Sent');
      end;

      if smtp.Connected then
        smtp.Disconnect;
      mail.Free;
      smtp.Free;
      //correo de confirmacion
Responder Con Cita