I want to have a TextBox where the user can enter in emails and these emails can be passed to an SMTP function where it is added to the message as a CC. I'm using the below code to try and add a ; in between each email before it is passed to the function. The problem is, it doesn't work. It also doesn't throw any errors. Can anyone tell me what I am doing wrong. If any other info is needed please let me know also. Thanks.


Dim mcc As String

Dim cccopy As String

mcc = nvarP7copy.Text.ToString


If mcc <> "" Or mcc <> String.Empty Then

Dim strCC() As String = Split(mcc, ";")Dim strThisCC As String
cccopy = Trim(strThisCC)

For Each strThisCC In strCC


Next

End If

Sorry the code should look like this:

Dim mcc As String

Dim cccopy As String

mcc = nvarP7copy.Text.ToString


If mcc <> "" Or mcc <> String.Empty Then

Dim strCC() As String = Split(mcc, ";")
Dim strThisCC As String

For Each strThisCC In strCC
cccopy = Trim(strThisCC)
Next

End If

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.