老师,错哪儿 ?
Dim o As New Microsoft.Office.Interop.Outlook.Application
Dim msg As Microsoft.Office.Interop.Outlook.MailItem
msg = o.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olMailItem)
msg.Recipients.Add("sum@aa.com")
For Each dr As DataRow In DataTables("表A").Select("到期日期<= #" & Date.Today.AddDays(10) & "#")
o.To = dr("sum@aa.com")
o.Title = "催款通知"
o.Content = dr("姓名") & dr("尊称") & ":" & ln & "您的贷款将于" & dr("到期日期") & "到期, "
o.Content = m.Content & "金额为" & dr("金额") & "元, 请准时还款!" & ln & "某某公司" & vbcrlf & Date.today
o.SendAsync()
Next
MSGBOX("DONE")