tags:

views:

26

answers:

0

Hi, I am using following code to send emails. It works from a computer where I have installed Windows XP but does not work from a computer where there is Windows Vista.

Could anybody explain what I should do?

Try

   Dim oSvr As New Net.Mail.SmtpClient("mail.server.com")
   Dim oMail As New Net.Mail.MailMessage

   oSvr.Credentials = New System.Net.NetworkCredential("[email protected]", "passwordhere")
   If AttachFilePath.Length > 0 Then
    oMail.Attachments.Add(New Net.Mail.Attachment(AttachFilePath))
   End If

   oMail.IsBodyHtml = IsHTML
   oMail.To.Add("[email protected]")
   oMail.Bcc.Add("[email protected]")
   oMail.From = New Net.Mail.MailAddress("[email protected]")
   oMail.Subject = sSubject
   oMail.Body = "<h1>HTML Body Here</h1>"
   oSvr.Send(oMail)
  Catch ex As Exception
   MessageBox.Show(ex.Message)
  End Try