Problem sending email with Exchange Server

Giganews Newsgroups
Subject: Problem sending email with Exchange Server
Posted by:  Feij√≥ (fei…@x.suply.com)
Date: Tue, 13 Dec 2005

I have this code:

var
  vMSG: TIdMessage;
  html: TIdText;
begin
  (...)

        vMSG.Body.Text := aCritica.Text;
//aCritica is a StringList with my msg, in HTML format

      html := TIdText.Create(vMSG.MessageParts);
      html.ContentType := 'text/html';
      html.Body.AddStrings(vMSG.Body);
      html := TIdText.Create(vMSG.MessageParts);
      html.ContentType := 'text/plain';
      html.Body.Text := 'This is a HTML email, you need better email
reader.';
      vMSG.Body.Clear;
      vMsg.ContentType := 'multipart/alternative';

    Send(vMsg);
end;

This work great with all smtp servers, but with Exchange the content of msg
body is: 'This is a HTML email, you need better email reader.'
All my text disapear!!!

There's any improvement possible in my code?

Thanks a lot
Feijó

Replies