sp;smtpClient.SendData msgsend
Text1.Text = Text1.Text + msgsend + FLAG_LINE_END
End Sub
Private Sub Send(from As String, to1 As String, subject As String, ctype As String, content As String)
Dim msgsend As String
msgsend = "From: " + from + FLAG_LINE_END
msgsend = msgsend + "To: " + to1 + FLAG_LINE_END
msgsend = msgsend + "Subject: " + subject + FLAG_LINE_END
msgsend = msgsend + "Date: " + CStr(Now) + FLAG_LINE_END
msgsend = msgsend + "MIME-Version: 1.0" + FLAG_LINE_END
msgsend = msgsend + "Content-Type: text/" + ctype + ";charset=gb2312" + FLAG_LINE_END
''msgSend = msgSend + "Content-Transfer-Encoding: base64" + flag_line_end
msgsend = msgsend + content + FLAG_LINE_END
smtpClient.SendData msgsend
smtpClient.SendData FLAG_MAIL_END
End Sub
Private Sub SetFrom(from As String)
msgsend = "MAIL FROM: <" + from + ">" + FLAG_LINE_END
smtpClient.SendData msgsend
Text1.Text = Text1.Text + msgsend + FLAG_LINE_END
End Sub
Private Sub SetRcpt(rcpt As String)
Dim msgsend As String
msgsend = "RCPT TO: <" + rcpt + ">" + FLAG_LINE_END
smtpClient.SendData msgsend
Text1.Text = Text1.Text + msgsend + FLAG_LINE_END
End Sub
Private Sub smtpClient_Error(ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean)
MsgBox Description
End Sub
2 func.bas
Attribute VB_Name = "Module1"
Private base64EncodeChars As String
Private base64DecodeChars(127) As Integer
Function base64encode(str As String) As String
base64EncodeChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
Dim out, i, len1
Dim c1, c2, c3
len1 = Len(str)
i = 0
out = ""
While i < len1
c1 = Asc(Mid(str, i + 1, 1))
i = i + 1
If (i = len1) Then
out = out + Mid(base64EncodeChars, c1 \ 4 + 1, 1)
out = out + Mid(base64EncodeChars, (c1 And 3) * 16 + 1, 1)
&n