send email in vb

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jamesd0142
    Contributor
    • Sep 2007
    • 471

    send email in vb

    using visual basic express edition 2005

    [code=vb]
    Private Sub email1()
    'server address
    Dim client As New SmtpClient("ima p.aol.com")

    'username and password
    client.Credenti als = New Net.NetworkCred ential("xxxxx", "xxx")

    Dim mm As New MailMessage("xx x@xxx.com", "xxx@xxx.co m")
    'Set Subject
    mm.Subject = "Test"
    'set message
    mm.Body = "test123"
    'html???
    mm.IsBodyHtml = True

    'send email
    Try
    client.Send(mm)
    'give error if any

    Catch ex As Exception
    'error message
    MessageBox.Show (ex.ToString)

    End Try
    End Sub
    [/code]

    this gets the the last part ' client.send(mm) then freezes and stops responding...

    Is there anything missing?

    Thanks
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    Question moved to .NET Forum.

    Comment

    Working...