I keep getting a message and I am not sure why. I don't see anything worng with this code. When I fill in all the fields and send the e-mail it says that it cannot send the e-mail. Exact error - Failure sending mail. SmtpException was unhandled. smtp.Send(message1) End error!
Any help or insight would be appreciated. Thank you.
VB.NET:
Dim tech As String
Dim tech1 As String
tech1 = txtemailto1.Text
Dim tech2 As String
tech2 = txtemailto2.Text
Dim tech3 As String
tech3 = txtemailto3.Text
Dim tech4 As String
tech4 = txtemailto4.Text
Dim tech5 As String
tech5 = txtemailto5.Text
Dim tech6 As String
tech6 = txtemailto6.Text
Dim tech7 As String
tech7 = txtemailto7.Text
Dim tech8 As String
tech8 = txtemailto8.Text
Dim tech9 As String
tech9 = txtemailto9.Text
Dim tech10 As String
tech10 = txtemailto10.Text
Dim tech11 As String
tech11 = txtemailto11.Text
Dim tech12 As String
tech12 = txtemailto12.Text
Dim tech13 As String
tech13 = txtemailto13.Text
Dim issue As String
issue = IssueTextBox.Text
Dim tasknumber As String
tasknumber = WorkOrderIDTextBox.Text
tech = tech1 + tech2 + tech3 + tech4 + tech5 + tech6 + tech7 + tech8 + tech9 + tech10 + tech11 + tech12 + tech13
Dim message1 As New System.Net.Mail.MailMessage()
message1.To.Add(tech)
message1.Subject = tasknumber
message1.From = New System.Net.Mail.MailAddress("XXXXX@XXXXXXXX.org")
message1.Body = issue
Dim smtp As New System.Net.Mail.SmtpClient("XXX.XX.XX.X")
smtp.Send(message1)
Any help or insight would be appreciated. Thank you.