I have been using system.net.mail successfully on our main domain on our own web server. We have a new domain and it has an SSL cert installed. I am trying to use my same code and I get an error. I am not sure what is wrong. I have tried enableSSL as true and false and neither works. If I set it to true I get an error "server does not support secure connections" otherwise my error says: "The server response was: receipt's email relaying prohibited. You should authenticate first."
Dim strFrom As String = "email@example.com"
Dim strTo As String = "firstname.lastname@example.org"
Dim MailMsg As New MailMessage(New MailAddress(strFrom.Trim()), New MailAddress(strTo))
MailMsg.BodyEncoding = Encoding.Default
MailMsg.Subject = "Application"
MailMsg.Body = "A new policy has been purchased. Please see attached."
MailMsg.Priority = MailPriority.High
MailMsg.IsBodyHtml = False
Dim SmtpMail As New SmtpClient
SmtpMail.Credentials = New System.Net.NetworkCredential("email@example.com", "password")
SmtpMail = Nothing