| View previous topic :: View next topic |
| Author |
Message |
Brad Wood Guest
|
Posted: Wed Dec 17, 2003 12:16 am Post subject: How to verify message sent to valid address |
|
|
I have looked at newsgroups and documentation and can't figure out how to do
this. Using Indy 9.0.14.
If I send a message via a TIdSMTP and then look at LastCmdResult.Text[0] it
reads "OK" whether I send the message to a valid address or not.
If I call GetResponse([220]) after sending a message (I have no idea what
220 indicates, I just saw it in a newsgroup, nor can I find constants like
"wsOK" that I have seen on newsgroups anywhere in Indy source), the method
never seems to return.
Is there a proper way to check the result of a sent message?
|
|
| Back to top |
|
 |
Paul Nicholls Guest
|
Posted: Wed Dec 17, 2003 12:25 am Post subject: Re: How to verify message sent to valid address |
|
|
AFAIK it is impossible to find out if a message was sent properly except if
a response email is received saying it failed...
"Brad Wood" <bwood (AT) colorflex (DOT) com> wrote
| Quote: | I have looked at newsgroups and documentation and can't figure out how to
do
this. Using Indy 9.0.14.
If I send a message via a TIdSMTP and then look at LastCmdResult.Text[0]
it
reads "OK" whether I send the message to a valid address or not.
If I call GetResponse([220]) after sending a message (I have no idea what
220 indicates, I just saw it in a newsgroup, nor can I find constants like
"wsOK" that I have seen on newsgroups anywhere in Indy source), the method
never seems to return.
Is there a proper way to check the result of a sent message?
|
|
|
| Back to top |
|
 |
Ben Hochstrasser [FF] Guest
|
Posted: Wed Dec 17, 2003 12:39 am Post subject: Re: How to verify message sent to valid address |
|
|
Brad Wood wrote:
| Quote: | If I send a message via a TIdSMTP and then look at
LastCmdResult.Text[0] it reads "OK" whether I send the message to a
valid address or not.
|
This just says that the remote smtp accepted your message for delivery. You
may or may not get a "transmission failed" report if the address turns out
to be non-existent.
Before sending the message, you could find out if there's an MX (Mail
eXchanger) for the recipient's domain. If there ain't any, then the address
is invalid. Now as you already know the MX, you could as well send your
mail to said MX. If there's no such user there, you'll get the result
immediately.
--
Ben
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Wed Dec 17, 2003 4:06 am Post subject: Re: How to verify message sent to valid address |
|
|
"Brad Wood" <bwood (AT) colorflex (DOT) com> wrote
| Quote: | If I send a message via a TIdSMTP and then look at
LastCmdResult.Text[0] it reads "OK" whether I send
the message to a valid address or not.
|
As well it should. You sent a message to the server, and it accepted it.
The message is not actually sent to the recipient until you have finished
transmitting the message to the server in full first. At which point, the
server has no way of knowing whether the recipient address is valid or not
until it actually attempts to deliver the message afterwards. The "OK" is
simply the server telling you that it accepted the message data.
| Quote: | Is there a proper way to check the result of a sent message?
|
If the address is invalid, you won't know right away. The message has to
actually travel to the mail server of the destination domain, which then
decides whether the username on the address is valid or not. If the
username is invalid, or for whatever reason the message cannot be delivered,
the server will email you back *as a completely separate email* the error
message to whichever email address you specified in the original message's
From and Sender fields. You have to check that email address's inbox in
order to receive the error message.
Gambit
|
|
| Back to top |
|
 |
Nicholas Ring Guest
|
Posted: Wed Dec 17, 2003 5:05 am Post subject: Re: How to verify message sent to valid address |
|
|
"Paul Nicholls" <paul-nicholls (AT) hotmail (DOT) com> wrote in
news:3fdfa26f$1 (AT) newsgroups (DOT) borland.com:
| Quote: | AFAIK it is impossible to find out if a message was sent properly
except if a response email is received saying it failed...
|
Assuming one is sent back... Other than that, I agree with Paul.
Cheers,
Nick
|
|
| Back to top |
|
 |
Richard Grossman Guest
|
Posted: Wed Dec 17, 2003 6:56 am Post subject: Re: How to verify message sent to valid address |
|
|
Remy Lebeau (TeamB) wrote:
| Quote: | The message has to
actually travel to the mail server of the destination domain, which then
decides whether the username on the address is valid or not. If the
username is invalid, or for whatever reason the message cannot be delivered,
the server will email you back *as a completely separate email* the error
message to whichever email address you specified in the original message's
From and Sender fields. You have to check that email address's inbox in
order to receive the error message.
|
Unless you send the email directly to the smtp server of the recipient?
--
"The system is less energetic when domains of opposite polarity
alternate." - Dr. Memory
|
|
| Back to top |
|
 |
Brad Wood Guest
|
Posted: Wed Dec 17, 2003 5:19 pm Post subject: Re: How to verify message sent to valid address |
|
|
Thank you. I tried calling the Resolve method of a TIdDNSResolver after
setting the QueryRecords array to contain just "qtMX" but I get the error,
"Connection reset by peer" no matter what domain I pass to Resolve.
The TIdDNSResolver seems to be pretty straight forward; I'm stumped as to
what I am doing wrong... ?
"Ben Hochstrasser [FF]" <bhoc@tiscali123^H^H^H.ch> wrote
| Quote: | Before sending the message, you could find out if there's an MX (Mail
eXchanger) for the recipient's domain. If there ain't any, then the
address
is invalid. Now as you already know the MX, you could as well send your
mail to said MX. If there's no such user there, you'll get the result
immediately.
|
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Wed Dec 17, 2003 7:39 pm Post subject: Re: How to verify message sent to valid address |
|
|
"Brad Wood" <bwood (AT) colorflex (DOT) com> wrote
| Quote: | I tried calling the Resolve method of a TIdDNSResolver after
setting the QueryRecords array to contain just "qtMX" but I get
the error, "Connection reset by peer" no matter what domain I
pass to Resolve.
The TIdDNSResolver seems to be pretty straight forward; I'm
stumped as to what I am doing wrong... ?
|
Did you set the Host property to a valid DNS server, such as the one
provided by your ISP?
Gambit
|
|
| Back to top |
|
 |
Ben Hochstrasser [FF] Guest
|
Posted: Wed Dec 17, 2003 7:41 pm Post subject: Re: How to verify message sent to valid address |
|
|
Remy Lebeau (TeamB) wrote:
| Quote: | Did you set the Host property to a valid DNS server, such as the one
provided by your ISP?
|
<scratches head>
with synapse it's just one line of code...
--
Ben
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Wed Dec 17, 2003 7:41 pm Post subject: Re: How to verify message sent to valid address |
|
|
"Richard Grossman" <rgrossmanDELETE-THIS-PART (AT) techIII (DOT) com> wrote
| Quote: | Unless you send the email directly to the smtp server of the recipient?
|
Perhaps, but 99% of the time, you are not allowed to do that. SMTP servers
do not allow arbitrary connections from just anyone. You should always send
messages to your own ISP's SMTP server, and then let it handle the
appropriate negotiations and such on the backend for you.
Gambit
|
|
| Back to top |
|
 |
Ben Hochstrasser [FF] Guest
|
Posted: Wed Dec 17, 2003 7:44 pm Post subject: Re: How to verify message sent to valid address |
|
|
Remy Lebeau (TeamB) wrote:
| Quote: | Perhaps, but 99% of the time, you are not allowed to do that. SMTP
servers do not allow arbitrary connections from just anyone. You
should always send messages to your own ISP's SMTP server, and then
let it handle the appropriate negotiations and such on the backend for
you.
|
Bah.
What a well-trained SMTP requires is that the HELO hostname actually
matches the IP address. (90% of the mail I get would do *not* pass that
hurdle, including Borland <g>).
It may be your ISP who is actually blocking that port, but per the RFCs
it's perfectly legal to contact the target MX directly.
Of course, having a smarthost at your ISP's (and actually using it) saves
you a lot of work.
--
Ben
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Wed Dec 17, 2003 8:43 pm Post subject: Re: How to verify message sent to valid address |
|
|
"Ben Hochstrasser [FF]" <bhoc@tiscali123^H^H^H.ch> wrote
| Quote: | with synapse it's just one line of code...
|
Synapse is not a component library. Indy is.
Gambit
|
|
| Back to top |
|
 |
Ben Hochstrasser [FF] Guest
|
Posted: Wed Dec 17, 2003 9:18 pm Post subject: Re: How to verify message sent to valid address |
|
|
Remy Lebeau (TeamB) wrote:
| Quote: | Synapse is not a component library. Indy is.
|
And? What good is a component e.g. in a service application for?
--
Ben
|
|
| Back to top |
|
 |
Ben Hochstrasser [FF] Guest
|
Posted: Wed Dec 17, 2003 10:10 pm Post subject: Re: How to verify message sent to valid address |
|
|
Remy Lebeau (TeamB) wrote:
| Quote: | And? What good is a component e.g. in a service application for?
If you are using TService, then it derives from TDataModule, and as
such can host components dropped onto it during design-time.
|
Okay. Try that with D3 <g>
What I meant to say is just because it's a component it's not better, let
alone more stable...
--
Ben
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Wed Dec 17, 2003 10:13 pm Post subject: Re: How to verify message sent to valid address |
|
|
"Ben Hochstrasser [FF]" <bhoc@tiscali123^H^H^H.ch> wrote
| Quote: | And? What good is a component e.g. in a service application for?
|
If you are using TService, then it derives from TDataModule, and as such can
host components dropped onto it during design-time.
Gambit
|
|
| Back to top |
|
 |
|