Sending Multiple Emails At Once

原创 2004年08月14日 16:30:00
Just like setting up emailing from a form, in general, is not difficult, neither is sending emails to multiple people at the same time. First, we need to dimension a variable called 'MyVar': to hold all the email addresses in a string:
Dim MyVar as String
In inline coding, this would be placed inside the script tag, but outside any Sub or Function.

Next we need to set up the BCC field, grabbing all the emails from a database field called (surprise!) 'email':

Dim MySQL as string = "Select email from yourTableName"
Dim MyConn As SqlConnection = New SqlConnection(ConfigurationSettings.AppSettings("UrAppString"))
Dim objDR as SQLDataReader
Dim Cmd as New SQLCommand(MySQL, MyConn)
While objDR.Read()
	MyVar+=objDR("email")& ";"
End While
The last line merely removes the semi-colon from the end that will naturally be placed there due to the line inside the While section.

You might want to check out another Tutorial here, called 'Emailing Form Results'. It goes over much of this next section also.

Dim objEmail as New MailMessage
objEmail.SUBJECT="This is my Subject"
objEmail.Body="Put text or a variable which represents the text - here"
objEmail.BodyFormat = MailFormat.Text
SmtpMail.SmtpServer =""
The main sections that needs addressing here are the BCC field, the BODY field, and the TO field. For most, the TO field will be fairly trivial. You don't need any of the people in the email addresses for this one. I usually use a mail back to me, in order to be sure the email actually went out. In the BCC field, you see that the list of emails in the 'MyVar' variable goes here, without double quotes surrounding it, since it's a variable and not an explicit email address. The same goes for the BODY section. If you wanted to define a section of text, and assign it to a variable, before this block of code, then, you would merely put the variable name there, without double quotes. Naturally, the SMTP server is important, since that's the mail server which you assign to send the emails out.

Hopefully, this takes a little mystery out of the whole 'sending multiple emails at the same time' scenario.

ValueError: Cannot run multiple SparkContexts at once; existing SparkContext ...

将代码写成如下形式: from pyspark import SparkContext sc.stop() #停止以前的SparkContext,要不然下面创建工作会失败 sc=SparkContex...
  • o1101574955
  • o1101574955
  • 2016年05月28日 11:34
  • 1995

spark:ValueError: Cannot run multiple SparkContexts at once解决方法

昨天花了一个下午的时间安装spark,并将pyspark的shell编辑界面配置到Jupyter Notebook,然后按照《spark快速大数据分析》这本书尝尝鲜,感受下spark的威力。本人的系统...
  • ZengHaihong
  • ZengHaihong
  • 2016年11月25日 23:59
  • 1417

改善C++ 程序的150个建议学习之建议 9:防止重复包含头文件

建议 9:防止重复包含头文件 假设,我们的工程中有如下三个文件 :a.h、b.h 和 c.cpp,其中 b 文件中包含了 a.h,c文件中又分别包含了 a.h 和 b.h 两个文件。在编译整个工程时...
  • baliguan163
  • baliguan163
  • 2013年09月10日 20:35
  • 1215

selenium+testng+gitblit+jenkins+ant自动化测试系列十一:使用Email Extersion Plugin替换Jenkins的默认邮件通知

前面的章节已经讲了如何使用jenkins进行自动化持续集成构建,jenkins执行了自动构建后,我们希望能够收到构建是否成功,以及测试执行是否成功的通知, 这里就需要用到jenkins的邮件通知功能。...
  • qq_15158911
  • qq_15158911
  • 2017年05月18日 11:46
  • 547

Spark:相关错误总结 FileNotFoundError: [Errno 2] No such fi...
  • pipisorry
  • pipisorry
  • 2016年10月24日 22:29
  • 14730

启动SparkContext时出错---ValueError: Cannot run multiple SparkContexts at once; existing SparkContext

启动SparkContext的时候,提示ValueError: Cannot run multiple SparkContexts at once; existing SparkContext(......
  • u010318270
  • u010318270
  • 2017年02月13日 09:53
  • 2852

Sending Emails and SAP Mail

The ABAP code to send a sap mail is built around the FM SO_OBJECT_SEND which has the following patte...
  • abap01
  • abap01
  • 2007年09月13日 10:42
  • 371

Sending Emails with the Zend Framework

 Introduction Many PHP applications require the ability to send emails nowadays from simple plain...
  • w_zhizhu
  • w_zhizhu
  • 2010年08月19日 21:36
  • 748

Sending Emails with Django CSRF Protection

Using django to send emails, CSRF.
  • Cavill
  • Cavill
  • 2015年10月18日 11:16
  • 586


spark编程python实例ValueError: Cannot run multiple SparkContexts at once; existing SparkContext(app=PySp...
  • dream_an
  • dream_an
  • 2016年07月17日 23:51
  • 11084
您举报文章:Sending Multiple Emails At Once