1

I made a mail client in Visual Basic (2008 if that matters) and it works perfectly on one laptop I tried it on, but on another it gives me the message: "Failure Sending Mail" What would cause that problem? I don't think it's firewall cause I tried turning the firewall off on the computer it wasn't working on but that didn't solve anything.

      Private Sub PictureBox2_Click(ByVal sender As System.Object, ByVal e As  System.EventArgs) Handles PictureBox2.Click
Try
    Dim smtpServer As New SmtpClient("smtp.aol.com")
    Dim Mail As New MailMessage()
    smtpServer.UseDefaultCredentials = False
    smtpServer.Credentials = New Net.NetworkCredential("Email", "Pass"
    smtpServer.Port = 587
    smtpServer.Host = "smtp.aol.com"
    smtpServer.DeliveryMethod = SmtpDeliveryMethod.Network
    smtpServer.EnableSsl = True
    Mail.From = New MailAddress("Email")
    Mail.To.Add("Email")
    smtpServer.Send(Mail)
Catch Ex As Exception
    MsgBox(Ex.Message)
End Try
  • 1
    Can you edit your question to include the whole Exception message and its stack trace? As it is now it's hard to figure what might be wrong. – Geeky Guy Sep 02 '13 at 14:54
  • Also add in `Catch SmtpEx As SmtpException` to catch other specific exceptions – Tim B James Sep 02 '13 at 15:13
  • SmtpExceptio is the same: Failure Sending Mail How would I acess the whole Exception message na dits stack tracee? – user2738036 Sep 02 '13 at 15:23

1 Answers1

0

This sounds like firewall problem (since this is case only on some machines) or maybe no internet connection avavilable on some laptops.

Check this solution from stackoverflow (not related with firewall): C# - Failure sending mail

Community
  • 1
  • 1
Moebius
  • 640
  • 4
  • 9