要实现加附件要怎么写?
想加个自定义的"回复到(reply to)"地址又怎么写呢?
白菜一个.Private Sub My_Date(ss As String)
Dim T As Long
Dim StrT As String
Dim Txt_Type As String
T = Val(Left(ss, 3))
Select Case int_BS
Case 1
If T = 220 Then
Win1.SendData "HELO <" & Win1.LocalIP & ">" & vbCrLf
int_BS = int_BS + 1
Else
Timer1_Timer
End If
Case 2
If T = 250 Then
Win1.SendData "MAIL FROM:<" & EmlFrom & ">" & vbCrLf
Text1.SelText = "MAIL FROM:<" & EmlFrom & ">" & vbCrLf
int_BS = int_BS + 1
Else
Timer1_Timer
End If
Case 3
If T = 250 Then
Win1.SendData "RCPT TO:<" & EmlStr & ">" & vbCrLf
Text1.SelText = "RCPT TO:<" & EmlStr & ">" & vbCrLf
int_BS = int_BS + 1
Else
Timer1_Timer
End If
Case 4
If T = 250 Then
Win1.SendData "DATA" & vbCrLf
Text1.SelText = "DATA" & vbCrLf
int_BS = int_BS + 1
Else
Timer1_Timer
End If
Case Else
Select Case T
Case 354
If Check1.Value > 0 Then
Txt_Type = "text/html"
Else
Txt_Type = "text/plain"
End If
StrT = "Date:" & Now & vbCrLf & "From:" & EmlFrom & vbCrLf & "To:" & EmlStr & vbCrLf
StrT = StrT & "Subject:" & Text2.Text & vbCrLf
StrT = StrT & "Mime-Version: 1.0" & vbCrLf & "Content-Type:" & Txt_Type & "; charset=GB2312" & vbCrLf
If Check2.Value > 0 Then StrT = StrT & "Disposition-Notification-To:" & EmlFrom & vbCrLf
StrT = StrT & vbCrLf & Text4.Text
Win1.SendData StrT
Text1.SelText = StrT
Win1.SendData vbCrLf & "." & vbCrLf
Text1.SelText = vbCrLf & "." & vbCrLf & vbCrLf
' Sleep 1000
int_BS = int_BS + 1
Case 250
Win1.SendData "QUIT" & vbCrLf
Text1.SelText = "Quit" & vbCrLf
Case 221
int_BS = 1
S_OK = True
Timer1_Timer
Case Else
Timer1_Timer
End Select
End Select
End SubPrivate Sub Timer1_Timer()
Command5.Enabled = True
Timer1.Enabled = False
If S_OK = True Then
MsgBox "发送成功!", vbInformation
Else
MsgBox "发送失败:" & DataStr, vbCritical
End If
If Win1.State > 0 Then Win1.Close
End Sub
想加个自定义的"回复到(reply to)"地址又怎么写呢?
白菜一个.Private Sub My_Date(ss As String)
Dim T As Long
Dim StrT As String
Dim Txt_Type As String
T = Val(Left(ss, 3))
Select Case int_BS
Case 1
If T = 220 Then
Win1.SendData "HELO <" & Win1.LocalIP & ">" & vbCrLf
int_BS = int_BS + 1
Else
Timer1_Timer
End If
Case 2
If T = 250 Then
Win1.SendData "MAIL FROM:<" & EmlFrom & ">" & vbCrLf
Text1.SelText = "MAIL FROM:<" & EmlFrom & ">" & vbCrLf
int_BS = int_BS + 1
Else
Timer1_Timer
End If
Case 3
If T = 250 Then
Win1.SendData "RCPT TO:<" & EmlStr & ">" & vbCrLf
Text1.SelText = "RCPT TO:<" & EmlStr & ">" & vbCrLf
int_BS = int_BS + 1
Else
Timer1_Timer
End If
Case 4
If T = 250 Then
Win1.SendData "DATA" & vbCrLf
Text1.SelText = "DATA" & vbCrLf
int_BS = int_BS + 1
Else
Timer1_Timer
End If
Case Else
Select Case T
Case 354
If Check1.Value > 0 Then
Txt_Type = "text/html"
Else
Txt_Type = "text/plain"
End If
StrT = "Date:" & Now & vbCrLf & "From:" & EmlFrom & vbCrLf & "To:" & EmlStr & vbCrLf
StrT = StrT & "Subject:" & Text2.Text & vbCrLf
StrT = StrT & "Mime-Version: 1.0" & vbCrLf & "Content-Type:" & Txt_Type & "; charset=GB2312" & vbCrLf
If Check2.Value > 0 Then StrT = StrT & "Disposition-Notification-To:" & EmlFrom & vbCrLf
StrT = StrT & vbCrLf & Text4.Text
Win1.SendData StrT
Text1.SelText = StrT
Win1.SendData vbCrLf & "." & vbCrLf
Text1.SelText = vbCrLf & "." & vbCrLf & vbCrLf
' Sleep 1000
int_BS = int_BS + 1
Case 250
Win1.SendData "QUIT" & vbCrLf
Text1.SelText = "Quit" & vbCrLf
Case 221
int_BS = 1
S_OK = True
Timer1_Timer
Case Else
Timer1_Timer
End Select
End Select
End SubPrivate Sub Timer1_Timer()
Command5.Enabled = True
Timer1.Enabled = False
If S_OK = True Then
MsgBox "发送成功!", vbInformation
Else
MsgBox "发送失败:" & DataStr, vbCritical
End If
If Win1.State > 0 Then Win1.Close
End Sub
http://download.csdn.net/detail/wolaix/4089772