locked
sending email more than five people RRS feed

All replies

  • User1831358492 posted
    You could pass an ArrayList to the stored procedure.  First build an array as follows:

    Dim myarraylist As New ArrayList
    myarraylist.add(email1)

    myarraylist.add(email2)
    myarraylist.add(email3)
    myarraylist.add(email4)
    myarraylist.add(email5)

    Now pass the array list to the stored procedure:

    Public Sub SendMailMessage(ByVal from As String, ByVal recepient As ArrayList, ByVal bcc() As String, ByVal cc() As String, ByVal subject As String, ByVal body As String)

    Now loop through the array and add to the To email address as follows:

    Dim torecepient As String
    For Each torecepient In recepient
      mMailMessage.To.Add(New MailAddress(torecepient))
    Next

    Monday, January 18, 2010 2:10 PM