If FileSys.DirectoryExists("E:\Publish\project\outlooksend") AndAlso FileSys.GetFiles("E:\Publish\project\outlooksend").Count > 0 Then
For Each File As String In FileSys.GetFiles("E:\Publish\project\outlooksend")
Dim s As String = FileSys.ReadAllText(file , Encoding.Default).Trim()
If s.Contains("∞") Then '用∞作为分割符
Dim Values() As String
Values = S.split("∞")
Dim fjs() As String '附件用;作为分隔符
fjs = values(4).split(";")
Dim emails() As String
emails = values(3).split(";")
Dim biaoti As String = Values(1)
biaoti = biaoti.Replace(chr(10)+ chr(13) , "")
biaoti = biaoti.Replace( "?" , "")
Dim zhengwen As String = Values(2)
zhengwen = zhengwen.Replace(chr(10)+ chr(13) , "")
zhengwen = zhengwen.Replace( "?" , "")
For youxiangs As Integer = 0 To emails.Length - 1
Dim dr As DataRow = DataTables("pclist").Find("mailaddress = '" & emails(youxiangs) & "'")
If dr IsNot Nothing Then
If dr("rank") < 8 Then
QQClient.SendChatMessage(dr("qqdepartment") & "." & dr("username"), "主题:" & biaoti & vbcrlf & "收件人:" & Values(5) & vbcrlf & "抄送人:" & Values(6) & vbcrlf & "正文:" & vbcrlf & zhengwen) '发送内容
If fjs.Length > 0 Then
System.Threading.Thread.Sleep(100)
For fujian As Integer = 0 To fjs.Length -1
If FileSys.FileExists(fjs(fujian)) Then
QQClient.SendChatFile(dr("qqdepartment") & "." & dr("username"), fjs(fujian)) '发送附件
End If
Next
End If
End If
End If
Next
FileSys.DeleteFile (file,2,2)
End If
Next
End If