Newsgroups : Borland : borland.public.delphi.internet.winsock : 2008 Jan : Re: I there a way to test a Indy mail connection?
| Subject: | Re: I there a way to test a Indy mail connection? |
| Posted by: | "Remy Lebeau (TeamB)" (no.spam@no.spam.com) |
| Date: | Wed, 23 Jan 2008 14:21:15 |
"Joseph Gordon" <pdsphx@parishdatainc.com> wrote in message
news:4797ad10@newsgroups.borland.com...
> I have an application which has the user setup their SMTP Server,
> Port, username and password. I would like to add a button to test
> the connect. Is there a way to do that without generating an actual
> e-mail.
You can certainly test whether the server can be connected to, and ensure it
is an SMTP port by issuing various SMTP commands that will not trigger an
email. But the only way to test whether the server will actually accept
your emails (relaying, etc) is to send a test email message.
> I would like it to be automatic. I don't want to say click this button
> and go into OE and check to see if an e-mail was delivered.
It doesn't matter what you use to trigger it. A button click, a timer, an
event, use whatever you need.
> I thought that maybe I could generate an e-mail with
> and invalid destination and see what kind of error I get
> back if all the user information is correct
No, because most of the time the destination can't be verified at the time
the email is sent. It has to go through the email system until it reaches a
point where the target is finally verified, and which time an error email is
sent back to the sender's email address separately, long after your SMTP
send has finished its work. The only time you will get an error at the SMTP
stage is if the server you connect to knows right away that the target is
bogus.
Gambit