Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Internet
Registrarse FAQ Miembros Calendario Guía de estilo Buscar Temas de Hoy Marcar Foros Como Leídos

Grupo de Teaming del ClubDelphi

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 06-07-2007
Avatar de aldmoscardi
aldmoscardi aldmoscardi is offline
Miembro
 
Registrado: oct 2006
Posts: 38
Poder: 0
aldmoscardi Va por buen camino
si, es lo que me paso a mi, por eso comente la linea que adjunta el archivo, calculo que puede estar el error en el html, en la parte de la referencia de la imajen, pero como no entiendo mucho de html lo deje asi nomas, por hay algien posee la solucion, aunque en el contexto original ese modulo realizaba varios envios y si se adjunta imajenes digamos que no seria lo mas eficiente.
Responder Con Cita
  #2  
Antiguo 06-07-2007
CORBATIN CORBATIN is offline
Miembro
 
Registrado: may 2003
Ubicación: España
Posts: 131
Poder: 22
CORBATIN Va por buen camino
Ok, entonces por lo que veo el problema/solucion esta en no adjuntar ficheros sino decirle al html de dónde tiene que coger esas fotos para que automaticamente las mande, igual que cuando elegimos un diseño de fondo al enviar un email, no las adjunta pero si las envia.

Ahora toca revisar html para sacar esa conclusión, hare pruebas.
__________________
No hay vientos favorables para quién no conoce su rumbo.
Responder Con Cita
  #3  
Antiguo 06-07-2007
Phantom_Drake Phantom_Drake is offline
Miembro
 
Registrado: jun 2007
Posts: 13
Poder: 0
Phantom_Drake Va por buen camino
Thumbs up

muchas gracias ContraVeneno, aldmoscardi practicamente junte lo ke decian los dos, modifike el archivo para convertir los rtf ke decia contraveneno con el txt ke venia en el ejemplo de aldmoscardi pero alfin pude mandar un correo con imagen de fondo y formato aunke solo imagenes ke estan en un server pero no hay pex con eso ya salgo del apuro y voy a tomar un server prestado para guardar las imagenes y leerlas de ahi . si alguien ocupa ver el ejemplo ke hice ps nomas avisen y lo subo o lo mando
Responder Con Cita
  #4  
Antiguo 08-07-2007
CORBATIN CORBATIN is offline
Miembro
 
Registrado: may 2003
Ubicación: España
Posts: 131
Poder: 22
CORBATIN Va por buen camino
Ok, te lo agradeceriamos todos si lo publicas, sobre todo yo, gracias.
__________________
No hay vientos favorables para quién no conoce su rumbo.
Responder Con Cita
  #5  
Antiguo 09-07-2007
Phantom_Drake Phantom_Drake is offline
Miembro
 
Registrado: jun 2007
Posts: 13
Poder: 0
Phantom_Drake Va por buen camino
simon no hay pex en la semana armo un ejemplo ya corriendo con todo como aldmoscardi y lo subo
Responder Con Cita
  #6  
Antiguo 11-07-2007
CORBATIN CORBATIN is offline
Miembro
 
Registrado: may 2003
Ubicación: España
Posts: 131
Poder: 22
CORBATIN Va por buen camino
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';
  //idMessage1.from.Text := 'PACO J GARCIA.';

  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';
    // you can actually load the body from a RichEdit with
    // slBody.Text := RichEdit1.LinesText;
    slBody.Add(atext);
    idText1 := TidText.Create(p, slBody);
    idText1.ContentType := 'text/html';
    idText2 := TidText.Create(p);
    idText2.ContentType := 'text/plain';
    idText2.Body.Text := '';
    // This shows how to add an attachment
    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.
__________________
No hay vientos favorables para quién no conoce su rumbo.
Responder Con Cita
  #7  
Antiguo 11-07-2007
Phantom_Drake Phantom_Drake is offline
Miembro
 
Registrado: jun 2007
Posts: 13
Poder: 0
Phantom_Drake Va por buen camino
Post

ps como no he tenido tiempo de acomodar el ejemplo ahi te va el codigo espero ke le puedas entender por ke esta todo desacomodado alguna duda no hay pex tu pregunta
Código Delphi [-]
procedure TFrm_Email.Button2Click(Sender: TObject);
var I,J,K,L,enviados:Integer;
    cadena,correo:string;
    Check: TcheckBox;
    ChildControl: TControl;
    html: TStrings;
    htmpart, txtpart: TIdText;
    bmppart: TIdAttachment;
    email: TIdMessage;
    //archiv:TStrings;
    filename,ss,filename1: string;
    a,count:Integer;
    idStars:   TIdAttachment;
    //archiv:t;
begin
  bandera:=true;
  enviados:=0;
  count:=0;
  Redt_Texto.Lines.SaveToFile('C:\WINDOWS\EMKTMP.RTF');
  r2hconv.rtf2html('C:\WINDOWS\EMKTMP.RTF', 'C:\WINDOWS\EMKTMP.HTM',['']);
  try
    RichEdit2.lines.LoadFromFile('C:\WINDOWS\EMKTMP.HTM');
    for A:=0 to RichEdit2.lines.Count -1 do
    begin
     SS:=RichEdit2.Lines.Strings[A];
     RichEdit1.Lines.Add(SS);
    end;
  finally
  richedit1.Lines.Add('');
  richedit1.Lines.Add('
'
); richedit1.Lines.Add('
'
); richedit1.Lines.Add('
'
); richedit1.Lines.Add('
'
); richedit1.Lines.Add('
'
); richedit1.Lines.Add('
'
); richedit1.Lines.Add('
'
); richedit1.Lines.Add(''); richedit1.Lines.Add(''); //RichEdit2.Free; end; if DBLookupComboBox1.Text='' then ShowMessage('debe seleccionar un formato') else begin Lst_Mails.Items.Clear; with dtm_contactos.Qry_Correos do begin Close; SQL.Clear; cadena:='select email from contactos where grupo<''0'' '; for I := 0 to GroupBox9.ControlCount - 1 do if GroupBox9.Controls[i] is TCheckBox then if TCheckBox(GroupBox9.Controls[i]).Checked then cadena:=cadena+ ' or grupo='''+(IntToStr(i+1))+''''; sql.Add(cadena); Open; First; if Lst_Correos.Items.Count > 0 then Lst_Mails.Items:=Lst_Correos.Items; while not Eof do begin Lst_Mails.Items.Add(fieldbyname('email').AsString); next; end; end; Lst_Correos.Items.Clear; ProgressBar1.Max:=Lst_Mails.Items.Count; Timer1.Enabled:=True; end; for K:=0 to Lst_Mails.Items.Count -1 do begin ProgressBar1.Position:=k+1; correo:= Lst_Mails.Items.Strings[k]; CopyFile(PChar('C:\Proyecto Email\Formatos\'+ DBLookupComboBox1.text ),PChar('C:\Archivos de programa\Borland\Delphi7\Projects\'+ DBLookupComboBox1.text),TRUE); //filename := ExtractFilePath(Application.ExeName) + '\homerorx.jpg'; //filename1 := 'C:\Proyecto Email\Formatos\'+ DBLookupComboBox1.text + ''''; filename := 'C:\Proyecto Email\Formatos\'+ DBLookupComboBox1.text ; html := TStringList.Create(); {html.Add(''); html.Add(''); html.Add(''); html.Add('

Hello

'); //html.Add(''); html.Add(''); html.Add('');}
for L:=0 to RichEdit2.lines.Count do begin html.Add(RichEdit2.Lines.Strings[L]); end; email := TIdMessage.Create(self); email.From.Text := 'correo'; email.Recipients.EMailAddresses := correo; email.Subject := 'Aviso Muelle 7'; email.ContentType := 'text/html'; email.charset := 'iso-8859-1'; email.Body.Assign(html); { txtpart := TIdText.Create(email.MessageParts); txtpart.ContentType := 'text/html'; txtpart.Body.Text := RichEdit2.Text; htmpart := TIdText.Create(email.MessageParts, html); htmpart.ContentType := 'text/html'; //htmpart.charset := 'iso-8859-1'; bmppart := TIdAttachment.Create(email.MessageParts, filename); bmppart.ExtraHeaders.Values['Content-ID'] := ''; bmppart.ContentType := 'image/html'; //bmppart.charset := 'iso-8859-1'; } try SMTP.Host:='smtp.prodigy.net.mx'; SMTP.Port:=25; If (k=0) OR (count=0)then SMTP.Connect(); try count:=count+1; SMTP.Send(email); //ShowMessage('Sent'); except on E: Exception do begin //ShowMessage('Failed: ' + E.Message); SMTP.disConnect(); SMTP.Connect(); SMTP.Send(email); end; end; end; finally email.Free(); html.Free(); if count=14 then begin SMTP.Disconnect; count:=0; end; enviados:=enviados+1; Label2.Caption:=IntToStr(enviados); end; end; ProgressBar1.Position:=0; ShowMessage('Mensajes Enviados Satisfactoriamente: ' + IntToStr(enviados)); SMTP.Disconnect(); end;
por cierto tambien tengo un problema con este solo me permite mandar hasta 70 correos alguien sabe como hacerle para ke no me rechaze la coexion el server?
Responder Con Cita
Respuesta


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

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


La franja horaria es GMT +2. Ahora son las 10:21:10.


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