Many web hosting now require sender authentication when sending e-mail through a relay server. These mail servers have their security locked down. Sometimes, localhost is an available SMTP server option, but if a relay server is required, a little extra code is also required.
ASP.Net offers the NetworkCredential class for this purposes. By setting the NetworkCredential property in the SMTPClient object with the appropriate credentials, authentication can be passed with the request. For example:
Dim smtp As New Net.Mail.SmtpClient
Dim m As New Net.Mail.MailMessage
m.Subject = "the subject"
m.From = New Net.Mail.MailAddress("email@example.com")
Dim Auth As New System.Net.NetworkCredential("firstname.lastname@example.org", "password")
smtp.UseDefaultCredentials = False
smtp.Credentials = Auth
smtp.Host = "smtp.domainname.com"