borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB Home | News Home | Forum Home | Downloads | Register | Search | PM | Profile

Previous Topic (DISCOVER VISUAL EXPERT!!!)Next Topic (How to get animating window when copying file) New Topic Post Reply
AndreaVB OnLine : Articles and tutorials : winsock
Poster Resource
soorena
Level: Big Cheese

Registered: 30-11-2003
Posts: 26
icon winsock

i debug your code and now you can send mail with it using winsock control..please reply me .
email:soorenam84@yahoo.com
Dim Reciever As Boolean
Dim Sender As Boolean
Dim MailStat As Boolean
Dim SendStat As Integer
Dim MailServer As String
Private Sub Command1_Click()
GetReady
Winsock1.Connect MailServer, 25
SendStat = 1
End Sub
Private Sub Form_Load()
MailServer = "mx1.mail.yahoo.com"
Reciever = False
Sender = False
GetReady
End Sub

Private Sub txtRecieve_GotFocus()
If Reciever = False Then
  txtrecieve.Text = ""
  Reciever = True
End If
End Sub

Private Sub txtSender_GotFocus()
If Sender = False Then
  txtsender.Text = ""
  Sender = True
End If
End Sub

Function GetReady()
Do While Winsock1.State <> sckClosed
  DoEvents
  Winsock1.Close
Loop
End Function


Private Sub Winsock1_Connect()
txtstatus.Text = "Connected.." & vbNewLine
End Sub

Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
Dim Data As String

Winsock1.GetData Data
txtstatus.SelLength = Len(txtstatus.Text)
txtstatus.SelText = Data

Select Case SendStat
  Case 1
   Winsock1.SendData "HELO yahoo.com" & vbCrLf
  Case 2
   Winsock1.SendData "MAIL FROM: " & txtsender.Text & vbCrLf
  Case 3
   Winsock1.SendData "RCPT TO: " & txtrecieve.Text & vbCrLf
  Case 4
   Winsock1.SendData "DATA" & vbCrLf
   Winsock1.SendData "subject: " & txtsubject.Text & vbCrLf
   Winsock1.SendData txtmessage.Text & vbCrLf
  Case 5
   Winsock1.SendData vbCrLf & "." & vbCrLf
  Case 6
   Winsock1.SendData "QUIT" & vbCrLf
  End Select
  SendStat = SendStat + 1
End Sub


  

01-12-2003 at 04:36 AM
View Profile Send Email to User Show All Posts | Add Comment
AndreaVB OnLine : Articles and tutorials : winsock
Previous Topic (DISCOVER VISUAL EXPERT!!!)Next Topic (How to get animating window when copying file)New Topic Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder