I am trying unsuccessfully to use the SmtpClient to send an email. The following code generates an error and fails. Any ideas?
Dim email As New Net.Mail.MailMessage(<Sender>, <Recipient>)
email.Subject = "My Subject"
email.Body = "My Body Text"
Dim MySmtp As New SmtpClient(<MyServerName>, <MySMTPPort>)
MySmtp.Credentials = New Net.NetworkCredential(<MySMTPServerLogin>, <MySMTPServerPassword>)
MySmtp.UseDefaultCredentials = True
MySmtp.DeliveryMethod = SmtpDeliveryMethod.Network
MySmtp.Send(email)