I have this code below and everytime I run it I get this error.
Private Sub SendEmail(ByVal sender As Object, ByVal e As EventArgs) Handles Button2.Click Email.To.Add(Settings.txtTo.Text) Email.From = New MailAddress(Settings.txtFrom.Text) Email.Body = "Email Body" Email.Subject = "Email Subject" SMTPServer.Host = Settings.txtSMTPServer.Text SMTPServer.Credentials = Authentication SMTPServer.Send(Email) End Sub
The error I get is: The parameter 'addresses' cannot be an empty string. Parameter name: addresses
And it's pointing to the Email.To.Add() section.
I thought the code would be pretty simple since I have text boxes in another form and I have linked to them before.
Thanks in advance for the help,
P.S. I've searched forums all over for help and haven't found anything that seems to help so I appreciate anything you can give me.