Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Mail.SmtpClient sending duplicates

Reply
Thread Tools

Mail.SmtpClient sending duplicates

 
 
=?Utf-8?B?QnJpYW4gTG9ycmFpbmU=?=
Guest
Posts: n/a
 
      06-13-2006
I tried out the new System.Net.Mail.SmtpClient feature of asp.net 2.0 and I
love it, but there's just one problem. When it sends an email out, it sends
to BOTH the TO and the FROM address. I have the following code which is very
simple.

------------------------snip----------------------------------
Dim client = New System.Net.Mail.SmtpClient("mail.mydomain.net")
client.Credentials = System.Net.CredentialCache.DefaultNetworkCredentia ls
lsEmailSubj = "test1"
lsEmailBody = "test2"
Dim msgmail As New
System.Net.Mail.MailMessage("globalitreporting@myd omain.com",
"(E-Mail Removed)", lsEmailSubj, lsEmailBody)
client.Send(msgmail)
--------------------------------------------------------------

This is the only part of my code that actually sends out the email and the
TO and FROM are hardcoded as you can see. However, TWO emails get sent out.
One is from globalitreporting, to user1 .. and... then it sends out the
second email FROM globalitreporting TO globalitreporting.

The really strange thing is that this only happens SOMETIMES, maybe 1/3 of
the time. Is there something about the SmtpClient class that I am forgetting
or is there some setting on my SMTP server that might be messing this up?

Does anyone have any ideas?

->Brian Lorraine

 
Reply With Quote
 
 
 
 
sloan
Guest
Posts: n/a
 
      06-13-2006
I have some email send code at my blog
spaces.msn.com/sholliday/
and i have never gotten a duplicate.


there is 1.1 and 2.0 code there.

I am not using an overloaded constructor like you are , fyi.



"Brian Lorraine" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I tried out the new System.Net.Mail.SmtpClient feature of asp.net 2.0 and

I
> love it, but there's just one problem. When it sends an email out, it

sends
> to BOTH the TO and the FROM address. I have the following code which is

very
> simple.
>
> ------------------------snip----------------------------------
> Dim client = New System.Net.Mail.SmtpClient("mail.mydomain.net")
> client.Credentials = System.Net.CredentialCache.DefaultNetworkCredentia ls
> lsEmailSubj = "test1"
> lsEmailBody = "test2"
> Dim msgmail As New
> System.Net.Mail.MailMessage("globalitreporting@myd omain.com",
> "(E-Mail Removed)", lsEmailSubj, lsEmailBody)
> client.Send(msgmail)
> --------------------------------------------------------------
>
> This is the only part of my code that actually sends out the email and the
> TO and FROM are hardcoded as you can see. However, TWO emails get sent

out.
> One is from globalitreporting, to user1 .. and... then it sends out the
> second email FROM globalitreporting TO globalitreporting.
>
> The really strange thing is that this only happens SOMETIMES, maybe 1/3 of
> the time. Is there something about the SmtpClient class that I am

forgetting
> or is there some setting on my SMTP server that might be messing this up?
>
> Does anyone have any ideas?
>
> ->Brian Lorraine
>



 
Reply With Quote
 
 
 
 
vMike
Guest
Posts: n/a
 
      06-13-2006

"Brian Lorraine" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I tried out the new System.Net.Mail.SmtpClient feature of asp.net 2.0 and I
> love it, but there's just one problem. When it sends an email out, it
> sends
> to BOTH the TO and the FROM address. I have the following code which is
> very
> simple.
>
> ------------------------snip----------------------------------
> Dim client = New System.Net.Mail.SmtpClient("mail.mydomain.net")
> client.Credentials = System.Net.CredentialCache.DefaultNetworkCredentia ls
> lsEmailSubj = "test1"
> lsEmailBody = "test2"
> Dim msgmail As New
> System.Net.Mail.MailMessage("globalitreporting@myd omain.com",
> "(E-Mail Removed)", lsEmailSubj, lsEmailBody)
> client.Send(msgmail)
> --------------------------------------------------------------
>
> This is the only part of my code that actually sends out the email and the
> TO and FROM are hardcoded as you can see. However, TWO emails get sent
> out.
> One is from globalitreporting, to user1 .. and... then it sends out the
> second email FROM globalitreporting TO globalitreporting.
>
> The really strange thing is that this only happens SOMETIMES, maybe 1/3 of
> the time. Is there something about the SmtpClient class that I am
> forgetting
> or is there some setting on my SMTP server that might be messing this up?
>
> Does anyone have any ideas?
>
> ->Brian Lorraine
>

Maybe something in you code is causing this process to run twice. How is it
called.?


 
Reply With Quote
 
Ray Booysen
Guest
Posts: n/a
 
      06-14-2006
The code running twice wouldn't explain the email being sent both to the
TO and FROM addresses.

vMike wrote:
> "Brian Lorraine" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> I tried out the new System.Net.Mail.SmtpClient feature of asp.net 2.0 and I
>> love it, but there's just one problem. When it sends an email out, it
>> sends
>> to BOTH the TO and the FROM address. I have the following code which is
>> very
>> simple.
>>
>> ------------------------snip----------------------------------
>> Dim client = New System.Net.Mail.SmtpClient("mail.mydomain.net")
>> client.Credentials = System.Net.CredentialCache.DefaultNetworkCredentia ls
>> lsEmailSubj = "test1"
>> lsEmailBody = "test2"
>> Dim msgmail As New
>> System.Net.Mail.MailMessage("globalitreporting@myd omain.com",
>> "(E-Mail Removed)", lsEmailSubj, lsEmailBody)
>> client.Send(msgmail)
>> --------------------------------------------------------------
>>
>> This is the only part of my code that actually sends out the email and the
>> TO and FROM are hardcoded as you can see. However, TWO emails get sent
>> out.
>> One is from globalitreporting, to user1 .. and... then it sends out the
>> second email FROM globalitreporting TO globalitreporting.
>>
>> The really strange thing is that this only happens SOMETIMES, maybe 1/3 of
>> the time. Is there something about the SmtpClient class that I am
>> forgetting
>> or is there some setting on my SMTP server that might be messing this up?
>>
>> Does anyone have any ideas?
>>
>> ->Brian Lorraine
>>

> Maybe something in you code is causing this process to run twice. How is it
> called.?
>
>

 
Reply With Quote
 
vMike
Guest
Posts: n/a
 
      06-14-2006

"Ray Booysen" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> The code running twice wouldn't explain the email being sent both to the
> TO and FROM addresses.
>
> vMike wrote:
>> "Brian Lorraine" <(E-Mail Removed)> wrote in
>> message news:(E-Mail Removed)...
>>> I tried out the new System.Net.Mail.SmtpClient feature of asp.net 2.0
>>> and I
>>> love it, but there's just one problem. When it sends an email out, it
>>> sends
>>> to BOTH the TO and the FROM address. I have the following code which is
>>> very
>>> simple.
>>>
>>> ------------------------snip----------------------------------
>>> Dim client = New System.Net.Mail.SmtpClient("mail.mydomain.net")
>>> client.Credentials =
>>> System.Net.CredentialCache.DefaultNetworkCredentia ls
>>> lsEmailSubj = "test1"
>>> lsEmailBody = "test2"
>>> Dim msgmail As New
>>> System.Net.Mail.MailMessage("globalitreporting@myd omain.com",
>>> "(E-Mail Removed)", lsEmailSubj, lsEmailBody)
>>> client.Send(msgmail)
>>> --------------------------------------------------------------
>>>
>>> This is the only part of my code that actually sends out the email and
>>> the
>>> TO and FROM are hardcoded as you can see. However, TWO emails get sent
>>> out.
>>> One is from globalitreporting, to user1 .. and... then it sends out the
>>> second email FROM globalitreporting TO globalitreporting.
>>>
>>> The really strange thing is that this only happens SOMETIMES, maybe 1/3
>>> of
>>> the time. Is there something about the SmtpClient class that I am
>>> forgetting
>>> or is there some setting on my SMTP server that might be messing this
>>> up?
>>>
>>> Does anyone have any ideas?
>>>
>>> ->Brian Lorraine
>>>

>> Maybe something in you code is causing this process to run twice. How is
>> it called.?
>>


ha , of course.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Removing duplicates from a DropdownList brian richards ASP .Net 1 08-04-2003 04:36 PM
Re: Removing duplicates from a DropdownList S. Justin Gengo ASP .Net 0 08-04-2003 04:31 PM
Re: Removing duplicates from a DropdownList brian richards ASP .Net 0 08-04-2003 04:30 PM
Re: Removing duplicates from a DropdownList William F. Robertson, Jr. ASP .Net 1 08-04-2003 04:16 PM
Removing duplicates from a DropdownList makthar ASP .Net 0 08-04-2003 04:13 PM



Advertisments