Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Difficulty using System.Net.Mail

Status
Not open for further replies.

miket26

Programmer
Apr 13, 2004
63
0
0
CA
I'm sending a basic smtp email using system.net.mail in vb.net. the problem I get is that I send my email to myself, but I don't recieve it until I close the application. Would anyone know why this weird problem is happening. It never used to happen when I used .Net 1.1 and system.web.mail
 
Here is the code

'Send email
Private Sub sendEmail(ByVal server As String, ByVal port As Integer, ByVal body As String, ByVal obj As Object)

client = New SmtpClient(server, port)

client.SendAsync("from@email.com", "to@email.com", "test message", body, obj)

End Sub

Private Sub test(ByVal sender As Object, ByVal e As System.ComponentModel.AsyncCompletedEventArgs) Handles client.SendCompleted
MsgBox("Message Sent")
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top