Dim m As New MailSender
m.Host = "smtp.qiye.163.com"
m.Account = aaaaaa.com" '指定登录邮件服务器的帐号
m.Password = "******"
m.from = "aaaaaa.com"
DataTables("员工资料").LoadFilter=""
DataTables("员工资料").Loadtop=""
DataTables("员工资料").Load
drs= DataTables("员工资料").SQLSelect("状态='在职' And Day(出生日期)= " & Date.Today.Day & " And Month(出生日期) =" & Date.Today.Month)
For Each dr As DataRow In drs
If xmxx=Nothing Then xmxx= dr("姓名") '代表人物名
If nms=Nothing Then
nms= dr("姓名")
Else
nms=nms & ";" & dr("姓名")
End If
Next
If drs.Count<>0 Then ' 有过生日的员工 xmxx<>Nothing Then
For Each a As Row In Tables("员工资料").Rows
If a.Isnull("邮箱")=True Then Continue For
m.To = a("邮箱")
If nms.Contains(a("姓名"))=True Then '本人
m.Title = a("姓名") & "公司给您的生日祝福"
m.C
Else
m.Title = "今天" & xmxx & ".....等人过生日!"
m.C
End If
m.SendAsync()
Next
End If
r("日期")=Date.Today
r.save
End If
用上述程序定时发送邮件。发现经常漏收邮件。如何检验异步发送是否全部发出呢?谢谢