I am new to C# and have a VB sub routine for sending emails.
I am not sure how to convert to C#, can someone please help me?
here is the sub:
Sub SendAdditionalEmails()
Dim strDelimeter As String = ","
Dim strEmailResult As String = ""
'make sure they dont put a comma on the end (To)
If InStr(Len(txtTo.Text) - 1, txtTo.Text, ",") > 0 Then
txtTo.Text = Mid(txtTo.Text, 1, Len(txtTo.Text) - 1)
End If
'put the emails into the array
Dim splitout As Array = Split(txtTo.Text, strDelimeter)
Dim i As Integer = 0
Me.pnlError.Visible = False
For i = 0 To UBound(splitout)
'loop through all the emails and send them ...
'-------------------------------------------------------------------
If SendEmail(splitout(i), txtSubject.Text, txtMessage.Text) = True Then
txtTo.Text = ""
txtSubject.Text = ""
txtMessage.Text = ""
chkTenantBrochure.Checked = False
lblSuccess.Text = lblSuccess.Text & "An email was sent to: " & splitout(i) & "<br>"
lblSuccess.Visible = True
Else
Me.pnlError.Visible = True
lblError.Text = lblError.Text & "An email did not get sent to: " & splitout(i) & "<br>"
lblError.Visible = True
End If
Next
End Sub