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) MyConn.Open() objDR=Cmd.ExecuteReader(system.data.CommandBehavior.CloseConnection) MyVar="" While objDR.Read() MyVar+=objDR("email")& ";" End While MyVar=MyVar.substring(0,(MyVar.Length-1))
Continues…
Pages: 1 2