1,502
社区成员
发帖
与我相关
我的任务
分享 wsk.SendData "--Unique-Boundary" & vbCrLf
wsk.SendData "Content-Type: multipart/parallel; boundary=Unique-Boundary-2" & vbCrLf & vbCrLf
wsk.SendData "--Unique-Boundary-2" & vbCrLf
wsk.SendData "Content-Type: application/octet-stream;" & vbCrLf
wsk.SendData " name=" & strAttachName & vbCrLf'strAttachName是附件含路径名
wsk.SendData "Content-Transfer-Encoding: base64" & vbCrLf
wsk.SendData "Content-Disposition: inline;" & vbCrLf
wsk.SendData " filename=" & strAttachName & vbCrLf & vbCrLf'strAttachName是附件含路径名
wsk.SendData txtEncodedFile.Text & "==" & vbCrLf'这个是干嘛的? 更多代码详见下面
wsk.SendData "--Unique-Boundary-2----Unique-Boundary--"
Option Explicit
Private Sub cmdAbout_Click()
frmAbout.Show vbModal
End Sub
Private Sub cmdClose_Click()
Unload Me
End Sub
Private Sub cmdSelect_Click()
cmdDialog.ShowOpen
txtAttach = cmdDialog.FileName
End Sub
Private Sub cmdSend_Click()
cmdSend.Enabled = False
If ValidateEntry = False Then MsgBox "Either the server name or to address were left empty.", vbCritical + vbOKOnly, Me.Caption: cmdSend.Enabled = True: Exit Sub
If txtAttach.Text <> "" Then
lblStatus = "Encoding file attachment"
Base64EncodeFile txtAttach.Text, rtfAttach, txtOutput
End If
lblStatus = "Connecting to POP Server"
ConnectToServer txtServer.Text, Winsock1
End Sub
Private Sub Form_Load()
txtAttach = ""
txtBody = ""
txtFromAddress = ""
txtServer = ""
txtSubject = ""
txtToAddress = ""
End Sub
Private Sub Winsock1_Connect()
lblStatus = "Connected to POP Server"
Wait 0.5
lblStatus = "Sending mail"
If txtAttach.Text = "" Then
SendMail txtFromAddress, txtToAddress, txtSubject, txtBody, Winsock1
Else
SendMail txtFromAddress, txtToAddress, txtSubject, txtBody, Winsock1, txtAttach, txtOutput
End If
lblStatus = "Mail sent"
cmdSend.Enabled = True
lblStatus = "Status:"
End Sub
Private Sub Winsock1_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 "Error Number: " & Number & vbCrLf & Description & vbCrLf & Source, vbCritical + vbOKOnly, Me.Caption
End Sub
Private Function ValidateEntry() As Boolean
ValidateEntry = True
If txtServer.Text = "" Or txtToAddress = "" Then ValidateEntry = False
End Function
每天回帖即可获得10分可用分Private Sub cmdSend_Click()
cmdSend.Enabled = False
If ValidateEntry = False Then MsgBox "Either the server name or to address were left empty.", vbCritical + vbOKOnly, Me.Caption: cmdSend.Enabled = True: Exit Sub
If txtAttach.Text <> "" Then
lblStatus = "Encoding file attachment"
Base64EncodeFile txtAttach.Text, rtfAttach, txtOutput '加密txtAttach.Text
End If
lblStatus = "Connecting to POP Server"
ConnectToServer txtServer.Text, Winsock1
End Sub
'=====================================
wsk.SendData " filename=" & strAttachName & vbCrLf & vbCrLf'strAttachName是附件含路径名
wsk.SendData txtEncodedFile.Text & "==" & vbCrLf'这个是干嘛的? 这就是发送附件啊 txtEncodedFile里的就是加密过的结果!!!!!!!!!!!!!!……