用这个方法可以不通过OutLook 直接用 vb 发送邮件: \'Wait 为延时你可用API或自己做!不延时时发送可能不成功的! \'strFrom :谁发的 \'strTo :发给谁 \'strSubject :主题 \'strBody :内容 \'wsk : Winsock控件 Public Sub SendMail(strFrom As String, strTo As String, strSubject As String, strBody As String, wsk As Winsock) Dim intCount As IntegerWait 0.5 wsk.SendData "EHLO " & wsk.LocalIP & vbCrLf wsk.SendData "MAIL FROM:" & strFrom & vbCrLfWait 0.5 wsk.SendData "RCPT TO:" & strTo & vbCrLf wsk.SendData "DATA" & vbCrLfWait 0.5 wsk.SendData "MIME-Version: 1.0" & vbCrLf wsk.SendData "From: " & ExtractArgument(1, strFrom, "@") & " <" & strFrom & ">" & vbCrLf wsk.SendData "To: <" & strTo & ">" & vbCrLf wsk.SendData "Subject: " & strSubject & vbCrLf wsk.SendData "Content-Type: multipart/mixed;" & vbCrLf wsk.SendData " boundary=Unique-Boundary" & vbCrLf & vbCrLf wsk.SendData " [ Random garbage here ]" & vbCrLf & vbCrLf wsk.SendData vbCrLf & "--Unique-Boundary" & vbCrLf wsk.SendData "Content-type: text/plain; charset=US-ASCII" & vbCrLf & vbCrLf wsk.SendData strBody & vbCrLf & vbCrLf wsk.SendData vbCrLf & "." & vbCrLfWait 0.5
标签:VB,邮件,发送