Click here to Skip to main content
15,889,315 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi guys,

I want to create a TCP connection to a mail server and get welcome message to use in my project.I want to write this program in C#. Are there anyone to help me about how this process works?
Posted

Yes this is pretty easy and lots of article are available in net. Anyway you might look into that [^] as well as this link also [^]
 
Share this answer
 
v2
It is easy, when your user logged in, if it is authenticated then collect EMail id and send it to the respective user.
what is the problem ? Technical or logical.
 
Share this answer
 
Comments
Çağlar Tolga Tetik 15-Sep-11 10:12am    
I guess, it is a technical problem. MyCode is here:

TcpClient tcp = new TcpClient();
tcp.ReceiveTimeout = 5;
tcp.Connect("sms01.cc.ankara.edu.tr",25);
byte[] data = new byte[255];
tcp.GetStream().Read(data, 0, 255);
recv = Encoding.ASCII.GetString(data, 0, 255);

When I write recv on the screen, I can't get the welcome message. I changed the name in the tcp.connect with many addresses (mx1.hotmail.com etc.).I changed also receivetimeout amount but, there is no welcome to server message yet.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900