These are a bit general problems in SMTP programming, not just in .NET framework but almost in every platform because the server requires something out of us, and we are not providing those content details. A few things to consider are to make sure that your SMTP server is configured to accept the requests to send email from control panel. You should try the following code with any of the provider, such as Gmail or Outlook and see if they work correctly.
' You should use a using statement
Using client As New SmtpClient("<smtp-server-address>", 25)
' Configure the client
client.EnableSsl = True
client.Credentials = New NetworkCredential("<username>", "<password>")
' client.UseDefaultCredentials = true;
' A client has been created, now you need to create a MailMessage object
' From field
' Recipient field
' Subject of the email message
' Email message body
Dim message As New MailMessage("from@example.com", "to@example.com", "Hello", "World!")
' Send the message
client.Send(message)
'
' * Since I was using Console app, that is why I am able to use the Console
' * object, your framework would have different ones.
' * There is actually no need for these following lines, you can ignore them
' * if you want to. SMTP protocol would still send the email of yours.
' Print a notification message
Console.WriteLine("Email has been sent.")
' Just for the sake of pausing the application
Console.Read()
End Using
'=======================================================
'Service provided by Telerik (www.telerik.com)
'Conversion powered by NRefactory.
'Twitter: @telerik
'Facebook: facebook.com/telerik
'=======================================================
The code was captured and converted from my article,
Sending emails over .NET framework, and general problems – using C# code[
^] and at the end of that article I talk about a few problems and "Failure sending mail" is one of them. In your code, I see no problem: 1) No http in hostname. 2) 25 port used. 3) username/password set.
The problem should be on the server, check that you are allowed to send the emails; it would be under the SMTP server's control panel. Otherwise, try the same VB.NET code for any other provider; Gmail, Outlook and see the results.