Thread View: borland.public.cppbuilder.internet.socket
1 messages
1 total messages
Started by Hans Galema
Fri, 22 Sep 2006 17:22
Wrapper for TIdMessage used by TIdSMTP
Author: Hans Galema
Date: Fri, 22 Sep 2006 17:22
Date: Fri, 22 Sep 2006 17:22
47 lines
2566 bytes
2566 bytes
Remembering this thread about a handy interface for sending mail: http://tinyurl.com/qvd89 and having installed Turbo C++ Explorer I migrated a bcb5 project. I'm forced now to take another component for TNMSMTP so decided for Indy9 TIdSMTP. I soon found out that one has to take TIdMessage also which is a nice design to compose and see the mail before it is handed over to the sender. Oh.. and one needs TIdText and TIdAttachment too. So I made a wrapperclass (TMyIdMessage) for TIdMessage with only four methods to be used by the programmer. The wrapper cares for TIdText and TIdAttachment. The four methods are: SetText( AnsiString Text ); SetHtmlText( AnsiString Text ); AddHtmlGraphic( AnsiString FileName ); AddAttachment( AnsiString FileName ); The programmer only uses TIdSMTP and TMyIdMessage. This is sufficient for mails which are composed as: -text only -html only -text+html -text+attachments -text+html+attachments -text+(html+graphic) -text+(html+graphic)+attachments Is it ready now? Well not completely. As mentioned in another post the resulting boundarys and ContentType's are different from what they have to be. (The wrapper does not set values for encoding or contenttype, except for IdText::ContentType). The nice thing is that thunderbird and OE don't seem to care as they display as intended. I will test further this weekend. For text+(html+graphic)+attachments I will put all code (without using the wrapper) in a TButton eventhandler, try it and then post it here and hopefully get help to get it right. Then I will adapt the wrapper and publish it here. Hans.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads