Here is an example of a telnet library along with a program that uses it to log into a Cisco router and download the IOS configuration.
http://www.xpresslearn.com/networking/code/csharp-telnet-client
AlhambraEidosDesarroll wrote:
how I do telnet
13-Jan-09
hi al
how can i do using c
telnet mail.domain.es 2
using c# cod
Iwant know if i can access to telnet (smtp 25) of a domain
thanks.
Previous Posts In This Thread:
how I do telnet
hi al
how can i do using c
telnet mail.domain.es 2
using c# cod
Iwant know if i can access to telnet (smtp 25) of a domain
thanks.
yes and no.You have built in classes for SMTP so you shouldnt have to "telnet".
yes and no
You have built in classes for SMTP so you shouldnt have to "telnet". If you
really must telnet then yes you have full access to sockets to do that also.
I dont think you have a base .net telnet class already rolled though
"Alhambra Eidos Desarrollo"
FYI you didnt mention what version but im on 2.0 and have System.Net.Mail.
FYI you didnt mention what version but im on 2.0 and hav
System.Net.Mail.SmtpClient available
"Alhambra Eidos Desarrollo"
Re: how I do telnet
Alhambra Eidos Desarrollo wrote
TcpClient class should do fine
Example
public static bool TestMailServer(string server
tr
string ownhost = Dns.GetHostName()
TcpClient client = new TcpClient(server, 25)
StreamWriter wrt = new StreamWriter(client.GetStream())
wrt.WriteLine("HELO " + ownhost)
wrt.WriteLine("QUIT")
wrt.Flush()
wrt.Close()
client.Close()
return true
catc
return false
Arne
Re: how I do telnet
anonymous wrote
The email classes can only be used to actually send an email no
to just test if the SMTP server are there
That may or may not be important
..NET does not come with telnet, but telnet is not needed for talkin
to a SMTP server. Basic socket is enough - and .NET has that - TcpClien
is most likely the easiest interface
Arne
Very crude example but you felt the need to elebrate on my response with
Very crude example but you felt the need to elebrate on my response with
garbage so here is one way to "test if the SMTP server are there" using the
SmtpClient
static void Main(string[] args
System.Net.Mail.SmtpClient smtpclient = new
System.Net.Mail.SmtpClient("192.168.0.250", 25)
tr
smtpclient.Send("root@localhost", "root@localhost",
"subject", "body")
catch (Exception ex
Console.WriteLine("Failure Sending\n" +
ex.InnerException.Message.ToString())
Console.Read()
return
Console.WriteLine("Success")
Console.Read()
Re: how I do telnet
anonymous wrote
Not garbage - pure truth
[code omitted
That code actually sends an email
Arne
Submitted via EggHeadCafe - Software Developer Portal of Choice
MSChart For VB.Net
http://www.eggheadcafe.com/tutorial...4dc6-9aa7-4f6246763650/mschart-for-vbnet.aspx