Question:
I hope you can help. I have a strange problem when sending an email from within a Delphi application using the Email ActiveX control.
I am using just the example program as is, and it actually can send an email. However, it only sends when I close the application. If I send more than one email, then they are queued up and all get sent when the application is closed. This is with email scanning turned on in my Anti-virus program (Norton). However, if I turn it off then the application works fine and the emails get sent immediately.
Answer:
This blog post http://www.chilkatsoft.com/p/p_176.asp discusses SMTP connections. The problem is that when sending email, the Chilkat component will keep the SMTP connection open so that subsequent calls to send mail can use the same SMTP connection. You can manually close the connection by calling mailman.CloseSmtpConnection (no arguments). The Chilkat mail-sending methods automatically open an SMTP connection if not already connected, so the next call to any mail-sending method will automatically re-establish the connection.