EAD
End Sub Private Function getipaddress(host As String) As Long Dim he As Long Dim hedesthost As hostent Dim addrlist As Long Dim rc As Long he = gethostbyname(host) If he = 0 Then MsgBox "主机名错误或网络错误!" rc = 0 Exit Function End If CopyMemory hedesthost, ByVal he, Len(hedesthost) CopyMemory addrlist, ByVal hedesthost.h_addr_list, 4 CopyMemory rc, ByVal addrlist, hedesthost.h_length getipaddress = rc End Function
Private Sub Text5_KeyDown(KeyCode As Integer, Shift As Integer) Dim datareceived As String Dim datasend As String datareceived = String$(255, Chr(0)) rc = recv(sll, datareceived, 255, 0) If rc <= 0 Then Exit Sub Text5.Text = Text5.Text & Left(datareceived, rc) If Left(datareceived, 3) = "220" Then datasend = "helo " & Text4.Text & vbCrLf If Left(datareceived, 3) = "250" And mailok = False Then datasend = "mail from:" & Text4.Text & vbCrLf mailok = True ElseIf Left(datareceived, 3) = "250" And mailok = True And rcptok = False Then datasend = "rcpt to:" & Text2.Text & vbCrLf rcptok = True ElseIf Left(datareceived, 3) = "250" And rcptok = True And sendok = False Then datasend = "data" & vbCrLf sendok = True ElseIf Left(datareceived, 3) = "250" And sendok = True Then Text5.Text = Text5.Text & "邮件发送成功!" closesocket sll WSACleanup Exit Sub End If If Left(datareceived, 3) = "354" Then datasend = Text3.Text & vbCrLf & "." & vbCrLf If Left(datareceived, 1) = "5" Then Text5.Text = Text5.Text & "邮件发送失败!" closesocket sll WSACleanup End If rc = send(sll, ByVal datasend, Len(datasend), 0)
End Sub
上一页 [1] [2] [系统软件]如何在Linux系统上进行快速磁带备份 [常用软件]在POWERBUILDER中使用WINSOCK控件的方法 [C语言系列]如何在Jbuilder9中使用SQLServer JDBC驱动 [VB.NET程序]如何在Visual Basic 6.0 中连接加密的Access数据库 [Delphi程序]Delphi Winsock Hooking Example by Aphex [Delphi程序]如何在delphi6中调试web程序 [Delphi程序]winsock 函数简介 [Delphi程序]如何在Delphi中用代码来完成计算字段的创建 [Delphi程序]如何在 Listbox 上显示 In-place Tooltips [Delphi程序]如何在Delphi应用程序中调用CHM文档
|