|
|
 |
| ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5 |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
|
 |

September 22nd, 2006, 05:49 AM
|
|
Authorized User
|
|
Join Date: Sep 2006
Location: , , .
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Can we connect yahoo,msn mail accounts using TCP?
Hi all,
can we connect yahoo,msn mail accounts using Sockets.TcpClient?
I yes how to doi it?what port number I've to use?
My code is like this
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
' ReadMail("website url", "userid", "password")
End Sub
Function ReadMail(ByVal host As String, ByVal user As String, ByVal pass As String)
' initialise objects
Dim netstream As System.Net.Sockets.NetworkStream
Dim thisResponse As String
Try
tcpC.Connect(host, 110)
Catch ex As Exception
Response.Write(ex.Message)
Response.End()
End Try
netstream = tcpC.GetStream()
thisResponse = GetResponse(netstream)
thisResponse = SendCommand(netstream, "user " & user & vbCrLf)
thisResponse = SendCommand(netstream, "pass " & pass & vbCrLf)
If Not Left(thisResponse, 4) = "-ERR" Then
Response.Write("Logged in OK <BR>")
Else
Response.Write("Error logging in, check your user details and try again<BR>")
Response.Write("<P>" & thisResponse & "</p>")
Response.End()
End If
End Sub
Function SendCommand(ByRef netstream As System.Net.Sockets.NetworkStream, ByVal sToSend As String)
Dim bData() As Byte = Encoding.ASCII.GetBytes(sToSend.ToCharArray)
netstream.Write(bData, 0, bData.Length())
Return GetResponse(netstream)
End Function
Function GetResponse(ByRef netstream As System.Net.Sockets.NetworkStream)
Dim bytes(tcpC.ReceiveBufferSize) As Byte
Dim ret As Integer = netstream.Read(bytes, 0, bytes.Length)
Dim returndata As String = Encoding.ASCII.GetString(bytes)
Return returndata
End Function
********************
It's working for my companys mail id (mailserver is connected in LAN)..if i use yahoo userid and password..its showing message
No connection could be made because the target machine actively refused it
How to do this?
Surya
|

September 22nd, 2006, 08:31 AM
|
|
Wrox Author
Points: 12,827, Level: 49 |
|
|
Join Date: Oct 2005
Location: Akron, Ohio, USA.
Posts: 4,029
Thanks: 1
Thanked 42 Times in 42 Posts
|
|
I believe yahoo and msn expose API's for you to be able to connect to their services but you would actually have to get the documentation from their site to figure out how to do it.
--Stole this from a moderator
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.
|

September 22nd, 2006, 10:17 AM
|
|
Authorized User
|
|
Join Date: Sep 2006
Location: , , .
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Iam not specific to yahoo or msn...
Actuallly i've to connect another website(its just like any other groups) by providing uid and pwd from my .net page..and to import all the contacts from mycontacts page to display in a .net page.
can i achieve this by tcp ?
or is there any alternative for that.
|

September 22nd, 2006, 10:53 AM
|
|
Wrox Author
Points: 12,827, Level: 49 |
|
|
Join Date: Oct 2005
Location: Akron, Ohio, USA.
Posts: 4,029
Thanks: 1
Thanked 42 Times in 42 Posts
|
|
Your trying to connect to a mail server? You should be able to connect to it using TCP but I am not 100% sure about it. Does the website you are connecting to expose some sort of API you can work through?
--Stole this from a moderator
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |