Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Indy changes 'text/html' to 'text/plain' with attachments

81 views
Skip to first unread message

Patrick Reusser

unread,
Aug 15, 2001, 9:00:25 AM8/15/01
to
Hi there

I currently have the following problem: I like to send an e-mail using the
indy components TIdMessage/TIdSMTP. When I send the e-mail in HTML format,
it works fine. But when I add an attachment to the e-mail, the body text is
defined by text/plain and not text/html. How can I change the ContentType
tag? Is there an article in a FAQ section somewhere that handles this
problem?

Thanks for your help in advance!
Pat


Hadi Hariri - Team Indy

unread,
Aug 15, 2001, 11:15:29 AM8/15/01
to
patrick...@logex.ch (Patrick Reusser) wrote in <3b7a7351$1_1@dnews>:

You have to define MessageParts of type TIdText with the html e-mail and
then add the attachments. Look at the mail-demo. It's very self-
explanatory.

Patrick Reusser

unread,
Aug 16, 2001, 4:47:36 AM8/16/01
to
Thanks!
In the mail-demo I finally got what I was looking for. But now, I have
another problem. I also found an entry under
borland.public.cppbuilder.internet from Alfred Thomas ('Help with Indy
components', 2nd of August 2001) who obviously has got the same problem, and
it's still unanswered.
If I try to send my e-mail, the compiler catches the following error
message:
Invalid text count. TIdText must be greater than 1.

The code I use:
TIdText* idtext;//=new TIdText;
IdMsgSend->MessageParts->Add();
idtext = new TIdText(IdMsgSend->MessageParts, Memo1->Lines);
idtext->ContentType = "text/html";
idtext->ContentTransfer = "quoted-printable";

The collection count of IdMsgSend->MessageParts seems to be increased by one
using these operations.

It would be very nice, if somebody could help me!!!
Thanks again!
Pat

"Hadi Hariri - Team Indy" <had...@pbe.com> schrieb im Newsbeitrag
news:3b7a9211_1@dnews...

0 new messages