Home All Groups Group Topic Archive Search About
Author
17 Oct 2006 2:05 PM
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("webmas***@email.net", "don***@email.net", "Online Search Request", txtBody)
MailObj = Nothing 'Cleanup

Thanks, Janet

Author
17 Oct 2006 3:22 PM
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...

--
Patrice

<Janet> a écrit dans le message de news:
%239mIdVf8GHA.4***@TK2MSFTNGP04.phx.gbl...
Show quoteHide quote
> 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("webmas***@email.net", "don***@email.net", "Online Search
> Request", txtBody)
> MailObj = Nothing 'Cleanup
>
> Thanks, Janet
>