email sending twice

J

Janet

With the code below, every email is sent twice. Anybody tell me why?

Dim txtBody as string
txtBody = "testing 2.0 email"

Dim MailObj As New System.Net.Mail.SmtpClient
MailObj.Host = "localhost"
MailObj.Send("(e-mail address removed)", "(e-mail address removed)", "Online Search Request", txtBody)
MailObj = Nothing 'Cleanup

Thanks, Janet
 
P

Patrice

My first move would be to add something unique in the mail, to make sure
it's really sent using a *single* call...

For now my thought would be rather that the event that triggers this code is
called twice (autoeventwireup + in code declaration for example) causing the
code to be called two times...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,091
Messages
2,570,604
Members
47,224
Latest member
Gwen068088

Latest Threads

Top