Posts

Send Email with HTML body format in Delphi

Sometime we need to send Email with HTML body format. So here I have explained two approach to send HTML Email by using Delphi. 1. By using  TIDText object With Indy components we can use same TIDSMTP and TIDMessage components to send a Email with normal Text body or HTML body in Delphi. But we also need to initiate a TIDText object so that we can set its   ContentType = text/html to allow HTML body format. And if we need an Image in HTML body then we also need to attach that image to mail body. So for that we need to create a  TIdAttachment object also. Here are the code details how to use TIDText.  And for this example I assume that we have already put TIDSMTP and TIDMessage component on form and also set required properties. For more information how to use TIDSMTP and TIDMessage visit my following blog. How to send Email in Delphi? lSMTP    : TIdSMTP; lMessage: TIdMessage; procedure TFormEmail.HTMLEmailSendClick(Sender: TO...

Filtering, Searching/Finding and Sorting records in ADO Datasets Delphi (TAdoQuery, TAdoTable, TAdoStoredProc)

Note. - Here in my article I have used Dataset word for TAdoQuery Component but we can apply the same for other TCustomADODataSet descendent component.  And this example assumes that TAdoQuery component is already opened with a valid SQL and have some data in memory. Filtering records in TAdoQuery by using Filter, Filtered property Filter records in TAdoquery means to access or show some specific records that exists in Adoquery dataset memory as per User's requirement.  After opened a TAdoquery dataset with valid SQL, we can still filter the fetched data at our client application side.  When we filter a dataset, we restrict access to a subset of records contained in the dataset's in-memory store.  For example, imagine that you have a AdoQuery dataset that includes Vendor's records, world-wide. Without filtering, all Vendor records are accessible in  the dataset. That is, it is possible to navigate, view, and edit any Vendor in the dataset. Through filter...

Input and Message Dialogs in Delphi

Image
Delphi Provides many procedures and function to show a message or to get some data from users by input box. ShowMessage ShowMessage procedure displays a string of Text in a simple dialog with an OK button. It is used to inform the user of some information - no  decision is needed by the user. Insert carriage return and line feed characters (#13#10) into the string to generate multi line message display. begin   // Show a simple message   ShowMessage('Hello World');   // Show a blank message   ShowMessage('');   // Split this into two lines   ShowMessage('Hello '+#13#10+'World'); end; ShowMessageFmt The ShowMessageFmt procedure provides 'C' like formatting of multiple of simple data types into a string that is displayed in a single.  It provides very precise control over this formatting. The Formatting parameter defines how the Data array is manipulated into the displayed string.  The dialog has an OK button...