p;msgsend = "DATA" + FLAG_LINE_END
smtpClient.SendData msgsend
Text1.Text = Text1.Text + msgsend + FLAG_LINE_END
state = 5
Case 550, 551, 552, 553, 450, 451, 452 ''failed
Quit
state = 7
Case 500, 501, 503, 421 ''error
Quit
state = 7
End Select
Case 5 ''DATA been sent
Select Case msgType
Case 354
Send "from", "to", "no subject", "plain", "test"
Text1.Text = Text1.Text + msgsend + FLAG_LINE_END
state = 6
Case 451, 554
Case 500, 501, 503, 421
End Select
Case 6 ''body been sent
Select Case msgType
Case 250
Quit
state = 7
Case 552, 451, 452
Case 500, 501, 502, 421
End Select
Case 7
Select Case msgType
Case 221 ''process disconnected
state = 0
Case 500 ''command error
End Select
End Select
End Sub
Private Sub Quit()
Dim msgsend As String
rs.Close
conn.Close
msgsend = "QUIT" + FLAG_LINE_END
&nb