public class SmtpAuthenticator extends javax.mail.Authenticator{
//SMTP身份验证
protected javax.mail.PasswordAuthentication getPasswordAuthentication()
{
return new javax.mail.PasswordAuthentication("coolwen.com","password");
}
}
Function getAttachments(ByVal msg As jmail.Message, ByVal receivetime As String)
Dim Attachments As New jmail.Attachments
Attachments = msg.Attachments
Dim separator As String = ", "
Dim i As Integer
For i = 0 To Attachments.Count - 1
If i = Attachments.Count - 1 Then
separator = ""
End If
Dim at As New jmail.Attachment
at = Attachments(i)
at.SaveToFile("c:\attachments\" & receivetime & "\" & at.Name)
Next
End Function