如何使用vb.net(广播)一次将电子邮件发送到多个帐户? [英] How to send email to many account at once using vb.net (broadcast) ?

查看:69
本文介绍了如何使用vb.net(广播)一次将电子邮件发送到多个帐户?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一次在vb.net上一次发送很多电子邮件,但我不知道该怎么做...
简直就是这样子...
如果datagridview中有电子邮件地址列表..

列表:
a@domain.com
b@domain.com
c@domain.com
d@domain.com
e@domain.com

所以,我只是认为我可以在该数据网格中使用尽可能多的行计数循环,
并发送该列表中每个地址的电子邮件...
我认为,如果它具有100行计数,那是无效的,我相信还有另一种方法可以做到这一点.
但是,我无法找到解决方法..请任何人都可以帮助我??

Hi, i need to send many email at once in one click on vb.net, but i don''t know how to do that...
simply, i thought like this...
if there is a list of email address in a datagridview..

List :
a@domain.com
b@domain.com
c@domain.com
d@domain.com
e@domain.com

So, I just think that I can use looping as much as Row Count in that datagrid,
and sending the email message for each address in that list...
I think''s it''s not effective if it''s have 100 row count, and i believe there is another way to do that..
but, I can''t find out how to do that.. Please, anybody can help me ??

推荐答案

这是代码

在mail.to.add(mail1@aa.com,mail2@bb.com .........)

this is the code

in mail.to.add( mail1@aa.com, mail2@bb.com.........)

Dim strBody As String 
        Dim SmtpServer As New SmtpClient()
        Dim mail As New System.Net.Mail.MailMessage
        SmtpServer.Credentials = New Net.NetworkCredential()
        SmtpServer.Port = 25
        SmtpServer.Host = 
        mail = New System.Net.Mail.MailMessage
        mail.From = New MailAddress()
        mail.To.Add()
        mail.CC.Add()
        mail.Bcc.Add()
        mail.Subject = 
        strBody = 


mail.Body = strBody

       SmtpServer.Send(mail)


这篇关于如何使用vb.net(广播)一次将电子邮件发送到多个帐户?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆