Subject | Strange SSL email send issue |
---|---|
Author | Robert Martin |
Post date | 2013-09-19T04:57:26Z |
Hi Remy
This isn't likely an Indy issue but I am asking here because it is
likely you will know straight away what the problem is (such is my faith
in your abilities) !
We have an app in use in a number of countries / sites without issue.
However in Jakarta (Indonesia) we have a site where the software can
send the first email (after opening the app) but subsequent emails fail
with a 'Connection timed out' error message. I have set the connect
timeout to 60000 for testing purposes and this makes no difference, the
time out occurs instantly, there is no pause. All the other sites all
use the same SMTP server (located in Australia). No other site has this
problem. There is only one Indonesian site.
Here is the procedure call that's failing. The connection is SSL with
correct username and password. The timeout occurs when calling
SMTPSendMail.Connect.
SMTPSendMail := TIdSMTP.Create;
if (fIndySMTPLoginDetails.UseSSL = True) then begin
SSLHandler :=
TIdSSLIOHandlerSocketOpenSSL.Create(SMTPSendMail);
end;
try
//Set up SMTP server
SMTPSendMail.AuthType := satDefault;
SMTPSendMail.Username := fIndySMTPLoginDetails.Username;
SMTPSendMail.Password := fIndySMTPLoginDetails.Password ;
if (fIndySMTPLoginDetails.UseSSL = True) then begin
SMTPSendMail.IOHandler := SSLHandler;
SMTPSendMail.UseTLS := utUseImplicitTLS;
end;
SMTPSendMail.Host := fIndySMTPLoginDetails.Host;
SMTPSendMail.Port := fIndySMTPLoginDetails.Port;
try
SMTPSendMail.Connect;
........
finally
if (fIndySMTPLoginDetails.UseSSL = True) then begin
SSLHandler.Free;
end;
SMTPSendMail.Free;
end;
I am away from work for a few days and will reply to any questions you
may have when I get back.
TIA
Rob
This isn't likely an Indy issue but I am asking here because it is
likely you will know straight away what the problem is (such is my faith
in your abilities) !
We have an app in use in a number of countries / sites without issue.
However in Jakarta (Indonesia) we have a site where the software can
send the first email (after opening the app) but subsequent emails fail
with a 'Connection timed out' error message. I have set the connect
timeout to 60000 for testing purposes and this makes no difference, the
time out occurs instantly, there is no pause. All the other sites all
use the same SMTP server (located in Australia). No other site has this
problem. There is only one Indonesian site.
Here is the procedure call that's failing. The connection is SSL with
correct username and password. The timeout occurs when calling
SMTPSendMail.Connect.
SMTPSendMail := TIdSMTP.Create;
if (fIndySMTPLoginDetails.UseSSL = True) then begin
SSLHandler :=
TIdSSLIOHandlerSocketOpenSSL.Create(SMTPSendMail);
end;
try
//Set up SMTP server
SMTPSendMail.AuthType := satDefault;
SMTPSendMail.Username := fIndySMTPLoginDetails.Username;
SMTPSendMail.Password := fIndySMTPLoginDetails.Password ;
if (fIndySMTPLoginDetails.UseSSL = True) then begin
SMTPSendMail.IOHandler := SSLHandler;
SMTPSendMail.UseTLS := utUseImplicitTLS;
end;
SMTPSendMail.Host := fIndySMTPLoginDetails.Host;
SMTPSendMail.Port := fIndySMTPLoginDetails.Port;
try
SMTPSendMail.Connect;
........
finally
if (fIndySMTPLoginDetails.UseSSL = True) then begin
SSLHandler.Free;
end;
SMTPSendMail.Free;
end;
I am away from work for a few days and will reply to any questions you
may have when I get back.
TIA
Rob