Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7740931
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T08:54:05+00:00 2026-06-01T08:54:05+00:00

We have been using ICS , THtmlSmtpCli to send emails from our applications for

  • 0

We have been using ICS, THtmlSmtpCli to send emails from our applications for some time now, both in the Main VCL thread and Threads. Earlier this week we discovered that it we are no longer able to send email from Threads. Sending it from the main VCL thread works fine.

So, I my question is two-fold:

  1. Has anybody experienced the same problem?
  2. Are there any other components that we could look at to send emails from Delphi Apps.

The code we use is as follows …

FRunning := True;
FHtmlSmtpClient := THtmlSmtpCli.Create(nil);
with FHtmlSmtpClient do
  begin
    Port := '25';
    Host := FHost;
    AuthType := smtpAuthNone;
    ConfirmReceipt := FReadReceipt;
    HdrPriority := smtpPriorityNone;
    ContentType := smtpHtml;
    FromName := FFromAddr;
    HdrFrom := FFromAddr;
    HdrTo := FToAddr;
    HdrSubject := FSubject;

    OnCommand := FHtmlSmtpClientCommand;
    OnRequestDone := FHtmlSmtpClientRequestDone;
    OnSessionClosed := FHtmlSmtpClientSessionClosed;

    { Start first operation to do to send an email          }
    { Next operations are started from OnRequestDone event  }
    Connect;
  end;

//Process the requests to send the email
procedure FHtmlSmtpClientRequestDone(Sender: TObject; RqType: TSmtpRequest; ErrorCode:     word);
begin
  if not FRunning then
    Exit;

  { Start next operation, but first check if previous one was OK }
  if ErrorCode <> 0 then
    begin
      FRunning := FALSE;   { Terminate All-In-One demo }
      Exit;
    end;

  case RqType of
    smtpConnect:
      begin
        if FHtmlSmtpClient.AuthType = smtpAuthNone then
          FHtmlSmtpClient.Helo
        else
          FHtmlSmtpClient.Ehlo;
      end;

    smtpHelo: FHtmlSmtpClient.MailFrom;
    smtpEhlo: FHtmlSmtpClient.Auth;
    smtpAuth: FHtmlSmtpClient.MailFrom;
    smtpMailFrom: FHtmlSmtpClient.RcptTo;
    smtpRcptTo: FHtmlSmtpClient.Data;
    smtpData: FHtmlSmtpClient.Quit;
    smtpQuit: FRunning := FALSE;
  end;
end;

Regards, Pieter.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T08:54:06+00:00Added an answer on June 1, 2026 at 8:54 am

    To answer your second question, you can use Indy, which ships with Delphi. It has TIdMessage and TIdSMTP components, and a TIdMessageBuilderHtml utility class.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been using json.NET successfully in projects for some time now without any
I have been using the python logging module for quite some time now, but
I have been using HTML4 for quite some time. I've heard of HTML5 for
I have been using a reset CSS set of styles for quite some time
We have been using MongoDB as our main datastore for a little while but
i have been using imdbpy for some time. I was interested in making a
I have been using Tperlregex for some time. but today when I try to
I have been using Eclipse as an IDE for a short amount of time
I have been using C# for a while now, and going back to C++
I have been using Ruby for a while now and I find, for bigger

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.