以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 一次性批量发送邮件 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=180079) |
-- 作者:漂亮美眉vszh -- 发布时间:2022/9/27 7:39:00 -- 一次性批量发送邮件 老师,发送邮件是主发一个,其他人员抄送,能否改为一次性发送,而不是抄送? Dim mail As New System.Net.Mail.MailMessage() Dim Result As DialogResult Dim dz As String = drs(kii)("域名") Dim dk As String = drs(kii)("端口") Dim zh As String = drs(kii)("账号") Dim mm As String= drs(kii)("密码") Dim sj As String = "" Dim i As Integer = 0 Dim zt As String Dim Products As List(Of String) Products = DataTables("表A").GetValues("收件人邮箱","","") ‘循环要发送的收件人列表 For Each Product As String In Products If sj = "" Then sj = Product Else sj = sj & ";" & Product ’===== 这样改发送不出去 \' mail.cc.Add(Product) \'抄送,一次性全部抄送才能发出去 End If csr = csr & "/" & Product Next zt = tb11 ’主题 nr = tb22 ‘内容 Dim smtp As New System.Net.Mail.SmtpClient(dz,dk) smtp.Credentials = New System.Net.NetworkCredential(zh,mm) mail.Subject = zt mail.SubjectEncoding = System.Text.Encoding.GetEncoding("GB2312") mail.BodyEncoding = System.Text.Encoding.GetEncoding("GB2312") mail.From = New System.Net.Mail.MailAddress(fj,"系统自动发送: ) mail.Priority = System.Net.Mail.MailPriority.Normal mail.IsBodyHtml = True mail.Body = nr sj = sj.Trim(",") mail.To.Add(sj) smtp.Send(mail) |
-- 作者:有点蓝 -- 发布时间:2022/9/27 8:44:00 -- 不抄送,就只能一个一个的发 |