Jump to content

SMTP Component Does Not Work In UniGUI But Works In VCL


Frederick

Recommended Posts

I created a test project that uses Overbyte's ICS to connect to a mail server. After entering the parameters and clicking the Connect button, nothing happens. The event that is attached to the SMTP component is never called.

However, when I create the exact same project in a VCL application, everything works as expected. 

What am I missing here?

P.S.   I have attached the testcase.

--
Frederick
(UniGUI Complete - Professional Edition 1.90.0.1551)
 

icsconnect_ung.png

icsconnect_win.png

icsconnect.zip

Link to comment
Share on other sites

Hi

We have used ICS components a lot over the years - and have been very pleased with them.  However we have found their architecture not well suited to Unigui.

In our implementations we tend to use a VCL program to send emails which we call from the Unigui sessions as needed, with parameters supplied either via the command line or database tables  - there are other discussions and demos on the forum regarding email solutions.

There is a thread from 2010 relating to ICS  -  Farshad's reply summed it up. Best of luck

It seems that Overbyte components use Async TCP/IP communication which

relies on Windows message events.

This requires component to reside inside a thread which can receive Windows

events. In unigui there are no such dedicated threads to sessions. Threads

are created and controlled by the Web server and for sessions threads are

only available during event execution. Moreover, it is not guaranteed that a

session will be always served by same thread. It can thread A in first event

and thread B in next event.

Link to comment
Share on other sites

6 hours ago, Harry Rogers said:

There is a thread from 2010 relating to ICS  -  Farshad's reply summed it up. Best of luck

It seems that Overbyte components use Async TCP/IP communication which

relies on Windows message events.

This requires component to reside inside a thread which can receive Windows

events. In unigui there are no such dedicated threads to sessions. Threads

are created and controlled by the Web server and for sessions threads are

only available during event execution. Moreover, it is not guaranteed that a

session will be always served by same thread. It can thread A in first event

and thread B in next event.

This statement confirms that ICS was incompatible with UniGUI 11 years ago but it would have been reassuring for technical support to confirm that ICS does not work with UniGUI today.

Link to comment
Share on other sites

5 hours ago, Roberto Nicchi said:

I have used Indy compnents in unigui app with no problems.

Maybe you miss some dll ? In indy i have to include the openssl dll if ssl is used.

I did use Indy components initially for test connecting to my mail server but it failed at the SSL handshaking stage. For some weird reason, connecting to a Google mail server did not pose a problem.

After revisiting Indy (because ICS does not work) in a new test project, connecting to my mail server and Google's mail server in 32 bit mode resulted in no errors. However, recompiling in 64 bit resulted in the same problems in my full project. I suspected that there were some issues with the SSL libraries and I read from a Google search that the SSL DLL files as installed by UniGUI should be copied to the app's output directory.

I did so and now, both mail servers can be connected to in 64 bit mode without errors.

Note: I am curious as to why the SSL DLL files in the Window's System32 directory are not referred to by the UniGUI app.

Link to comment
Share on other sites

1 minute ago, Frederick said:

I did use Indy components initially for test connecting to my mail server but it failed at the SSL handshaking stage. For some weird reason, connecting to a Google mail server did not pose a problem.

After revisiting Indy (because ICS does not work) in a new test project, connecting to my mail server and Google's mail server in 32 bit mode resulted in no errors. However, recompiling in 64 bit resulted in the same problems in my full project. I suspected that there were some issues with the SSL libraries and I read from a Google search that the SSL DLL files as installed by UniGUI should be copied to the app's output directory.

I did so and now, both mail servers can be connected to in 64 bit mode without errors.

Note: I am curious as to why the SSL DLL files in the Window's System32 directory are not referred to by the UniGUI app.

Don't know. I always copy the dll in the application directory.

Link to comment
Share on other sites

13 hours ago, irigsoft said:

Check in openssl documentations .

I'll leave the reading of the OpenSSL documentation to security enthusiasts 🙂. Us mere mortals need only know that we can use the Indy components in a secure environment as long as the two SSL DLL files are copied to the same directory as the application. 

Link to comment
Share on other sites

3 hours ago, Frederick said:

I'll leave the reading of the OpenSSL documentation to security enthusiasts 🙂. Us mere mortals need only know that we can use the Indy components in a secure environment as long as the two SSL DLL files are copied to the same directory as the application. 

:)

Link to comment
Share on other sites

3 hours ago, Fred Montier said:

After all option excluded, set your account to work with less secure app. At GMail (smtp.gmail.com), that is really a issue. Not sure about smtp.googlemail.com.

Using Indy works just fine.


 

Thank you for the confirmation.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...