Ver Mensaje Individual
  #7  
Antiguo 29-09-2008
smessina smessina is offline
Miembro
 
Registrado: ene 2006
Posts: 51
Reputación: 19
smessina Va por buen camino
mail en formato hmtl con imagen en outlook

Hola perdon por retrotraerlos a este post, pero necesito mandar un mail con imagenes, para lo que entiendo que debo mandarlo en formato html, lo que dice este post me sirvio en su momento para mandarlo con las indy pero yo necesito mandarlo por outlook 2003, y no me queda claro como se haria, le pongo el codigo que yo uso
Código Delphi [-]
        html := TStringList.Create();
        html.Add('');
        html.Add('');
        html.Add('');
        html.Add('

Lo que sea

'
); html.Add(''); html.Add(''); Outlook := CreateOleObject('Outlook.Application'); miMail := Outlook.CreateItem(olMailItem); miMail.Recipients.Add('smessina@dcom.com.ar'); miMail.Subject := 'Mensaje de Prueba'; // alternatively send an HTML email (not in Outlook 97) miMail.HTMLBody := html.Text; miMail.Attachments.Add(camino+'imagen.jpg'); miMail.Send;

pero me llega el mail sin la imagen por lo que creo que me faltaria definir esta parte :
Código Delphi [-]
  htmpart := TIdText.Create(email.MessageParts, html);
  htmpart.ContentType := 'text/html';

  bmppart := TIdAttachment.Create(email.MessageParts, filename);
  bmppart.ContentType := 'image/jpeg';
  bmppart.FileIsTempFile := true;
  bmppart.ContentDisposition := 'inline';
  bmppart.ExtraHeaders.Values['content-id'] := 'us.jpg';

  bmppart.DisplayName := 'us.jpg';

pero no se como aplicarlo a mi codigo para poder mandarlo por outlook.


Gracias por su tiempo.

Santiago.
Responder Con Cita