Any help that anyone can provide to my coding would be greatly appreciated here. I'm very frustrated that I can't figure this out. What am I missing or doing wrong?

Using VB 2010 Express, I have code for an AT&T email account that has worked great in the past, but since they have changed their login criteria, I have not been able to connect.

The old data was as follows:
Port: 25

The new settings are now:
Port: 465
SMTP required authentication.
Server requires an encrypted connection (SSL)

Here is my code with the old data commented out and the updates applied. At the end is the error message I receive.

Imports System.Net.Mail

Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click

Dim SmtpServer As New SmtpClient()
Dim mail As New MailMessage()
SmtpServer.Credentials = New _
Net.NetworkCredential("", "password")

'SmtpServer.Port = 25 '<=== Old Port
SmtpServer.Port = 465 '<=== New Port

'SmtpServer.Host = ""'<=== Old Host
SmtpServer.Host = "" '<=== New Host

SmtpServer.EnableSsl = True '<=== I added this code for new connection

mail = New MailMessage()
mail.From = New MailAddress("")
mail.Subject = "My Test Mail"
mail.Body = "This is for testing SMTP mail using .NET"

MsgBox("mail sent")

Catch ex As Exception
End Try

End Sub

When ran I get this error:

System.Net.Mail.SmtpException: Failure sending mail. - System.IO.IOExecption: Unable to read data from the transport connection: net_io_connectionclosed.
at SystemNet.Mail.SmtpReplyReaderFactory.ProcessRead(Byte[] buffer, Int32 read, Boolean readline)
at SystemNet.Mail.SmtpReplyReaderFactory.ReadLines(SmptReplyReader caller, Boolean online)
at SystemNet.Mail.SmtpReplyReaderFactory.ReadLine(SmtpReplyReader caller)
at SystemNet.Mail.SmtpConnection.GetConnection(ServicePoint servicePoint)
at SystemNet.Mail.SmtpClient.GetConnection()
at SystemNet.Mail.SmtpClient.Send(MailMessage message)
---End of inner exception stack trace ---
at System.Net.MailSmtpClient.Send(MailMessage message)
at WindowsApplication1.Form1.Button1_Click(Object sender, EventArgs e) in C:\Documents and Settings\MyName\Local Settings\Application\Data\Temporary Projects\WindowsApplication1\Form1.vb:line 33