Verify SMTP service. 
Author Message
 Verify SMTP service.

When sending a mail using the SmtpMail class and pass it
a MailMessage class instance, then is it possible to verify
that the SMTP service (local on Win2k / XP machine) or
any given SMTP service thats used is active/accessible?

The class doesnt appear to throw an exception when you
call the Send method if the SMTP is invalid.

Also how do you enter authentication (user & pass) to
be used with the SMTP you choose to use?

--
Andreas H?kansson
Student of Software Engineering
andreas (at) selfinflicted.org



Thu, 07 Oct 2004 00:55:18 GMT  
 Verify SMTP service.
Andreas, for your last question, the SmtpMail class does not have the
ability to let you specify credentials to the SMTP server.

For checking invalid SMTP names, one thing you could do is to use the Dns
class to resolve the SMTP server name before calling SmtpMail.Send.

-glenn-


Quote:
> When sending a mail using the SmtpMail class and pass it
> a MailMessage class instance, then is it possible to verify
> that the SMTP service (local on Win2k / XP machine) or
> any given SMTP service thats used is active/accessible?

> The class doesnt appear to throw an exception when you
> call the Send method if the SMTP is invalid.

> Also how do you enter authentication (user & pass) to
> be used with the SMTP you choose to use?

> --
> Andreas H?kansson
> Student of Software Engineering
> andreas (at) selfinflicted.org



Thu, 07 Oct 2004 06:30:45 GMT  
 Verify SMTP service.
Ok so I have to use a smtp server that allows the use of
anonymous login, which isn't a nice thing at all, since
most smtp's doesn't relay to prevent spam.

As for checking invalid SMTP's there is a need to be
able to check if the local SMTP service is running or not
as well.

--
Andreas H?kansson
Student of Software Engineering
andreas (at) selfinflicted.org


Quote:
> Andreas, for your last question, the SmtpMail class does not have the
> ability to let you specify credentials to the SMTP server.

> For checking invalid SMTP names, one thing you could do is to use the Dns
> class to resolve the SMTP server name before calling SmtpMail.Send.

> -glenn-



> > When sending a mail using the SmtpMail class and pass it
> > a MailMessage class instance, then is it possible to verify
> > that the SMTP service (local on Win2k / XP machine) or
> > any given SMTP service thats used is active/accessible?

> > The class doesnt appear to throw an exception when you
> > call the Send method if the SMTP is invalid.

> > Also how do you enter authentication (user & pass) to
> > be used with the SMTP you choose to use?

> > --
> > Andreas H?kansson
> > Student of Software Engineering
> > andreas (at) selfinflicted.org



Thu, 07 Oct 2004 07:44:10 GMT  
 Verify SMTP service.
Andreas, you don't have to use a SMTP server that allows the use of
"anonymous login". In fact, unless you are running one yourself, you
probably won't be able to find one (spammers love these). What most ISPs do
to allow "anonymous login" but also keep the spammers out is to restrict who
can use their SMTP server by IP address.

I don't think I understand what you mean by being able to check if the local
SMTP service is running or not. What local SMTP service are you referring
to? Couldn't you just try connecting to the SMTP server, sending the
handshake message, and if you get an ack you know the service is running?

-glenn-


Quote:
> Ok so I have to use a smtp server that allows the use of
> anonymous login, which isn't a nice thing at all, since
> most smtp's doesn't relay to prevent spam.

> As for checking invalid SMTP's there is a need to be
> able to check if the local SMTP service is running or not
> as well.

> --
> Andreas H?kansson
> Student of Software Engineering
> andreas (at) selfinflicted.org



> > Andreas, for your last question, the SmtpMail class does not have the
> > ability to let you specify credentials to the SMTP server.

> > For checking invalid SMTP names, one thing you could do is to use the
Dns
> > class to resolve the SMTP server name before calling SmtpMail.Send.

> > -glenn-



> > > When sending a mail using the SmtpMail class and pass it
> > > a MailMessage class instance, then is it possible to verify
> > > that the SMTP service (local on Win2k / XP machine) or
> > > any given SMTP service thats used is active/accessible?

> > > The class doesnt appear to throw an exception when you
> > > call the Send method if the SMTP is invalid.

> > > Also how do you enter authentication (user & pass) to
> > > be used with the SMTP you choose to use?

> > > --
> > > Andreas H?kansson
> > > Student of Software Engineering
> > > andreas (at) selfinflicted.org



Thu, 07 Oct 2004 09:49:46 GMT  
 Verify SMTP service.
What is the handshake message can you give an example
Thanks

Quote:
> Andreas, you don't have to use a SMTP server that allows the use of
> "anonymous login". In fact, unless you are running one yourself, you
> probably won't be able to find one (spammers love these). What most ISPs
do
> to allow "anonymous login" but also keep the spammers out is to restrict
who
> can use their SMTP server by IP address.

> I don't think I understand what you mean by being able to check if the
local
> SMTP service is running or not. What local SMTP service are you referring
> to? Couldn't you just try connecting to the SMTP server, sending the
> handshake message, and if you get an ack you know the service is running?

> -glenn-



> > Ok so I have to use a smtp server that allows the use of
> > anonymous login, which isn't a nice thing at all, since
> > most smtp's doesn't relay to prevent spam.

> > As for checking invalid SMTP's there is a need to be
> > able to check if the local SMTP service is running or not
> > as well.

> > --
> > Andreas H?kansson
> > Student of Software Engineering
> > andreas (at) selfinflicted.org



> > > Andreas, for your last question, the SmtpMail class does not have the
> > > ability to let you specify credentials to the SMTP server.

> > > For checking invalid SMTP names, one thing you could do is to use the
> Dns
> > > class to resolve the SMTP server name before calling SmtpMail.Send.

> > > -glenn-



> > > > When sending a mail using the SmtpMail class and pass it
> > > > a MailMessage class instance, then is it possible to verify
> > > > that the SMTP service (local on Win2k / XP machine) or
> > > > any given SMTP service thats used is active/accessible?

> > > > The class doesnt appear to throw an exception when you
> > > > call the Send method if the SMTP is invalid.

> > > > Also how do you enter authentication (user & pass) to
> > > > be used with the SMTP you choose to use?

> > > > --
> > > > Andreas H?kansson
> > > > Student of Software Engineering
> > > > andreas (at) selfinflicted.org



Thu, 07 Oct 2004 12:12:53 GMT  
 Verify SMTP service.
The SMTP RFC defines the protocol to communicate with an SMTP server. I
believe that you just connect to the SMTP server's port and it sends back an
"+OK" if it is alive and well.

-glenn-


Quote:
> What is the handshake message can you give an example
> Thanks


> > Andreas, you don't have to use a SMTP server that allows the use of
> > "anonymous login". In fact, unless you are running one yourself, you
> > probably won't be able to find one (spammers love these). What most ISPs
> do
> > to allow "anonymous login" but also keep the spammers out is to restrict
> who
> > can use their SMTP server by IP address.

> > I don't think I understand what you mean by being able to check if the
> local
> > SMTP service is running or not. What local SMTP service are you
referring
> > to? Couldn't you just try connecting to the SMTP server, sending the
> > handshake message, and if you get an ack you know the service is
running?

> > -glenn-



> > > Ok so I have to use a smtp server that allows the use of
> > > anonymous login, which isn't a nice thing at all, since
> > > most smtp's doesn't relay to prevent spam.

> > > As for checking invalid SMTP's there is a need to be
> > > able to check if the local SMTP service is running or not
> > > as well.

> > > --
> > > Andreas H?kansson
> > > Student of Software Engineering
> > > andreas (at) selfinflicted.org



> > > > Andreas, for your last question, the SmtpMail class does not have
the
> > > > ability to let you specify credentials to the SMTP server.

> > > > For checking invalid SMTP names, one thing you could do is to use
the
> > Dns
> > > > class to resolve the SMTP server name before calling SmtpMail.Send.

> > > > -glenn-



> > > > > When sending a mail using the SmtpMail class and pass it
> > > > > a MailMessage class instance, then is it possible to verify
> > > > > that the SMTP service (local on Win2k / XP machine) or
> > > > > any given SMTP service thats used is active/accessible?

> > > > > The class doesnt appear to throw an exception when you
> > > > > call the Send method if the SMTP is invalid.

> > > > > Also how do you enter authentication (user & pass) to
> > > > > be used with the SMTP you choose to use?

> > > > > --
> > > > > Andreas H?kansson
> > > > > Student of Software Engineering
> > > > > andreas (at) selfinflicted.org



Thu, 07 Oct 2004 12:51:19 GMT  
 Verify SMTP service.
Glenn, if no SMTP server is defined in the SmtpMail object then
it will use the local SMTP Server if you are running on a Win2K
or WinXP machine.

Since you can turn of this service, or skip installing it completly
I need to find out if it's avalible.

--
Andreas H?kansson
Student of Software Engineering
andreas (at) selfinflicted.org


Quote:
> Andreas, you don't have to use a SMTP server that allows the use of
> "anonymous login". In fact, unless you are running one yourself, you
> probably won't be able to find one (spammers love these). What most ISPs
do
> to allow "anonymous login" but also keep the spammers out is to restrict
who
> can use their SMTP server by IP address.

> I don't think I understand what you mean by being able to check if the
local
> SMTP service is running or not. What local SMTP service are you referring
> to? Couldn't you just try connecting to the SMTP server, sending the
> handshake message, and if you get an ack you know the service is running?

> -glenn-



> > Ok so I have to use a smtp server that allows the use of
> > anonymous login, which isn't a nice thing at all, since
> > most smtp's doesn't relay to prevent spam.

> > As for checking invalid SMTP's there is a need to be
> > able to check if the local SMTP service is running or not
> > as well.

> > --
> > Andreas H?kansson
> > Student of Software Engineering
> > andreas (at) selfinflicted.org



> > > Andreas, for your last question, the SmtpMail class does not have the
> > > ability to let you specify credentials to the SMTP server.

> > > For checking invalid SMTP names, one thing you could do is to use the
> Dns
> > > class to resolve the SMTP server name before calling SmtpMail.Send.

> > > -glenn-



> > > > When sending a mail using the SmtpMail class and pass it
> > > > a MailMessage class instance, then is it possible to verify
> > > > that the SMTP service (local on Win2k / XP machine) or
> > > > any given SMTP service thats used is active/accessible?

> > > > The class doesnt appear to throw an exception when you
> > > > call the Send method if the SMTP is invalid.

> > > > Also how do you enter authentication (user & pass) to
> > > > be used with the SMTP you choose to use?

> > > > --
> > > > Andreas H?kansson
> > > > Student of Software Engineering
> > > > andreas (at) selfinflicted.org



Thu, 07 Oct 2004 21:08:15 GMT  
 Verify SMTP service.

The +OK is for POP servers, not SMTP.

You can connect to the server and do a HELO
and then you should get 250 OK back ( the text can
be different but you always get 250 ) and then you'll
have to do a  QUIT.

Patrik.

Quote:

> The SMTP RFC defines the protocol to communicate with an SMTP server. I
> believe that you just connect to the SMTP server's port and it sends back an
> "+OK" if it is alive and well.

> -glenn-



> > What is the handshake message can you give an example
> > Thanks


> > > Andreas, you don't have to use a SMTP server that allows the use of
> > > "anonymous login". In fact, unless you are running one yourself, you
> > > probably won't be able to find one (spammers love these). What most ISPs
> > do
> > > to allow "anonymous login" but also keep the spammers out is to restrict
> > who
> > > can use their SMTP server by IP address.

> > > I don't think I understand what you mean by being able to check if the
> > local
> > > SMTP service is running or not. What local SMTP service are you
> referring
> > > to? Couldn't you just try connecting to the SMTP server, sending the
> > > handshake message, and if you get an ack you know the service is
> running?

> > > -glenn-



> > > > Ok so I have to use a smtp server that allows the use of
> > > > anonymous login, which isn't a nice thing at all, since
> > > > most smtp's doesn't relay to prevent spam.

> > > > As for checking invalid SMTP's there is a need to be
> > > > able to check if the local SMTP service is running or not
> > > > as well.

> > > > --
> > > > Andreas H?kansson
> > > > Student of Software Engineering
> > > > andreas (at) selfinflicted.org



> > > > > Andreas, for your last question, the SmtpMail class does not have
> the
> > > > > ability to let you specify credentials to the SMTP server.

> > > > > For checking invalid SMTP names, one thing you could do is to use
> the
> > > Dns
> > > > > class to resolve the SMTP server name before calling SmtpMail.Send.

> > > > > -glenn-



> > > > > > When sending a mail using the SmtpMail class and pass it
> > > > > > a MailMessage class instance, then is it possible to verify
> > > > > > that the SMTP service (local on Win2k / XP machine) or
> > > > > > any given SMTP service thats used is active/accessible?

> > > > > > The class doesnt appear to throw an exception when you
> > > > > > call the Send method if the SMTP is invalid.

> > > > > > Also how do you enter authentication (user & pass) to
> > > > > > be used with the SMTP you choose to use?

> > > > > > --
> > > > > > Andreas H?kansson
> > > > > > Student of Software Engineering
> > > > > > andreas (at) selfinflicted.org



Thu, 07 Oct 2004 21:19:30 GMT  
 Verify SMTP service.

Actually to be even more correct, once you connect to
the SMTP server it will send a header back such as:
192.168.0.1 SMTP/POP3 Server ready

and then you can send a HELO <host> and if everything is ok
you'll get a 250 OK reply back, after that you have to send a
QUIT to the server so it knows you are done with it.

You can read the rfc for the SMTP protocol for more info:
http://www.ietf.org/rfc/rfc0821.txt

Patrik.

Quote:

> The +OK is for POP servers, not SMTP.

> You can connect to the server and do a HELO
> and then you should get 250 OK back ( the text can
> be different but you always get 250 ) and then you'll
> have to do a  QUIT.

> Patrik.



Thu, 07 Oct 2004 21:31:31 GMT  
 Verify SMTP service.
Andreas, you could use the loopback address and open the SMTP port and try
to go through the handshake sequence.

Or you could use the GetProcessByName method of the Process class to see if
the service is running.


Quote:
> Glenn, if no SMTP server is defined in the SmtpMail object then
> it will use the local SMTP Server if you are running on a Win2K
> or WinXP machine.

> Since you can turn of this service, or skip installing it completly
> I need to find out if it's avalible.

> --
> Andreas H?kansson
> Student of Software Engineering
> andreas (at) selfinflicted.org



> > Andreas, you don't have to use a SMTP server that allows the use of
> > "anonymous login". In fact, unless you are running one yourself, you
> > probably won't be able to find one (spammers love these). What most ISPs
> do
> > to allow "anonymous login" but also keep the spammers out is to restrict
> who
> > can use their SMTP server by IP address.

> > I don't think I understand what you mean by being able to check if the
> local
> > SMTP service is running or not. What local SMTP service are you
referring
> > to? Couldn't you just try connecting to the SMTP server, sending the
> > handshake message, and if you get an ack you know the service is
running?

> > -glenn-



> > > Ok so I have to use a smtp server that allows the use of
> > > anonymous login, which isn't a nice thing at all, since
> > > most smtp's doesn't relay to prevent spam.

> > > As for checking invalid SMTP's there is a need to be
> > > able to check if the local SMTP service is running or not
> > > as well.

> > > --
> > > Andreas H?kansson
> > > Student of Software Engineering
> > > andreas (at) selfinflicted.org



> > > > Andreas, for your last question, the SmtpMail class does not have
the
> > > > ability to let you specify credentials to the SMTP server.

> > > > For checking invalid SMTP names, one thing you could do is to use
the
> > Dns
> > > > class to resolve the SMTP server name before calling SmtpMail.Send.

> > > > -glenn-



> > > > > When sending a mail using the SmtpMail class and pass it
> > > > > a MailMessage class instance, then is it possible to verify
> > > > > that the SMTP service (local on Win2k / XP machine) or
> > > > > any given SMTP service thats used is active/accessible?

> > > > > The class doesnt appear to throw an exception when you
> > > > > call the Send method if the SMTP is invalid.

> > > > > Also how do you enter authentication (user & pass) to
> > > > > be used with the SMTP you choose to use?

> > > > > --
> > > > > Andreas H?kansson
> > > > > Student of Software Engineering
> > > > > andreas (at) selfinflicted.org



Thu, 07 Oct 2004 21:58:29 GMT  
 
 [ 10 post ] 

 Relevant Pages 

1. Atl Service as SMTP Gateway...

2. VC++, NT Services, DLLs, SMTP, Thread Safety, and OO4O :-)

3. smtp service

4. Verifying assemblies

5. verifying message

6. sscanf to Verify Numeric IP Address

7. how to verify that the pressed key is dijit not a char

8. Signing an assembly and verifying it over the network

9. sscanf For Verifying Numeric IP Addresses

10. sscanf to Verify Numeric IP Address

11. C program to verify MS CD-Key

12. verifying translations

 

 
Powered by phpBB® Forum Software