p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Professional
I forgot my password Register Now
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 22nd, 2006, 05:49 AM
Authorized User
 
Join Date: Sep 2006
Location: , , .
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old September 22nd, 2006, 08:31 AM
Wrox Author
Points: 12,827, Level: 49
Points: 12,827, Level: 49 Points: 12,827, Level: 49 Points: 12,827, Level: 49
Activity: 15%
Activity: 15% Activity: 15% Activity: 15%
 
Join Date: Oct 2005
Location: Akron, Ohio, USA.
Posts: 4,029
Thanks: 1
Thanked 42 Times in 42 Posts
Send a message via AIM to dparsons
Default

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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #3 (permalink)  
Old September 22nd, 2006, 10:17 AM
Authorized User
 
Join Date: Sep 2006
Location: , , .
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #4 (permalink)  
Old September 22nd, 2006, 10:53 AM
Wrox Author
Points: 12,827, Level: 49
Points: 12,827, Level: 49 Points: 12,827, Level: 49 Points: 12,827, Level: 49
Activity: 15%
Activity: 15% Activity: 15% Activity: 15%
 
Join Date: Oct 2005
Location: Akron, Ohio, USA.
Posts: 4,029
Thanks: 1
Thanked 42 Times in 42 Posts
Send a message via AIM to dparsons
Default

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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to implement tabs like yahoo mail gabrieldcr2 ASP.NET 2.0 Professional 0 October 4th, 2008 09:53 AM
Can we connect yahoo,msn mail accounts using TCP? suryasimha ASP.NET 2.0 Professional 1 September 22nd, 2006 12:35 PM
mail.yahoo.com Type Login Form hunzian78@yahoo.com ASP.NET 1.0 and 1.1 Basics 5 March 14th, 2006 10:53 AM
Please help me to connect smtp mail server ansar BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 1 December 7th, 2004 03:40 PM
MSN / Yahoo messenger like pop up window tact_259 General .NET 4 May 12th, 2004 03:30 PM



All times are GMT -4. The time now is 03:02 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc