I am trying to allow my program to send emails via a smtp server. Everything seems to be working the only problem is that i get an error response from the server saying
The Code that I am using is
Dim fromAddress As New MailAddress("from@mail.com", "Support")
Dim toAddress As New MailAddress(txtEmail.Text, "User")
Dim msg As New MailMessage(fromAddress, toAddress)
msg.Body = My.Application.Info.DirectoryPath + "\support\mailtemplate.html"
msg.Subject = "Support Ticket"
msg.IsBodyHtml = True
Dim mailSender As New System.Net.Mail.SmtpClient()
mailSender.Host = "mail.myserver.com"
mailSender.Port = 587
Try
mailSender.Send(msg)
MsgBox("Message sent")
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
All I think I have to do is set up authentication for the server, but im not sure how to do that!
Thanks,
-jimmy

