Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Unordered extra copies of e-mail message sent

Reply
Thread Tools

Unordered extra copies of e-mail message sent

 
 
Pete
Guest
Posts: n/a
 
      09-05-2007
Hi - The following e-mail program runs completely successfully on my
PC, using VS2005, except that one click of the button seemingly-
randomly causes smtp.1and1.com to send either 1, 2, or 3 identical
copies of the message, one right after the other. Any ideas?

<%@ Page Language="VB" %>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System.Net" %>
<%@ Import Namespace="System.Net.Mail" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/
TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Simple E-mail Program</title>
<script runat="server">
Private Sub SendMail_Click(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles
Button1.Click
Dim message As New MailMessage()
message.Subject = "Trial"
message.Body = "<html><body>This is a <b>test</b> message.</
body></html>"
message.IsBodyHtml = True
message.From = New MailAddress("...")
message.To.Clear()
message.To.Add(New MailAddress("..."))
Dim client As New SmtpClient("smtp.1and1.com", 587)
Dim SenderLogInID As String = "..."
Dim SenderLogInPW As String = "..."
client.Credentials = New NetworkCredential(SenderLogInID,
SenderLogInPW)
message.ReplyTo = New MailAddress("...")
client.Send(message)
End Sub
</script>
</head>
<body>
<form id="Form1" runat="server">
<aspanel ID="Panel1" runat="server" Height="40px" Width=130
Style="z-index: 101; left: 200px; position: absolute;
top: 32px;">
<asp:Button ID="Button1" runat="server" Font-Bold="True"
Text="Send Message" OnClick="SendMail_Click" Width=110
BackColor="#C0FFC0" BorderStyle="Outset"
Style="z-index: 102; left: 20px; position: absolute; top:
20px; text-align: center;" />
</aspanel>
</form>
</body>
</html>

 
Reply With Quote
 
 
 
 
Patrice
Guest
Posts: n/a
 
      09-05-2007
Is this something you see yourself ? If not it could be that some users are
just clicking multiple times on the button (for example double clicking by
mistake). You could check the IIS log to see if the POST has been done
multiple times (and possibly implement a verification so that it is cliekd
once).


"Pete" <(E-Mail Removed)> a écrit dans le message de news:
(E-Mail Removed). com...
> Hi - The following e-mail program runs completely successfully on my
> PC, using VS2005, except that one click of the button seemingly-
> randomly causes smtp.1and1.com to send either 1, 2, or 3 identical
> copies of the message, one right after the other. Any ideas?
>
> <%@ Page Language="VB" %>
> <%@ Import Namespace="System.IO" %>
> <%@ Import Namespace="System.Net" %>
> <%@ Import Namespace="System.Net.Mail" %>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/
> TR/xhtml11/DTD/xhtml11.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml">
> <head id="Head1" runat="server">
> <title>Simple E-mail Program</title>
> <script runat="server">
> Private Sub SendMail_Click(ByVal sender As Object, _
> ByVal e As System.EventArgs) Handles
> Button1.Click
> Dim message As New MailMessage()
> message.Subject = "Trial"
> message.Body = "<html><body>This is a <b>test</b> message.</
> body></html>"
> message.IsBodyHtml = True
> message.From = New MailAddress("...")
> message.To.Clear()
> message.To.Add(New MailAddress("..."))
> Dim client As New SmtpClient("smtp.1and1.com", 587)
> Dim SenderLogInID As String = "..."
> Dim SenderLogInPW As String = "..."
> client.Credentials = New NetworkCredential(SenderLogInID,
> SenderLogInPW)
> message.ReplyTo = New MailAddress("...")
> client.Send(message)
> End Sub
> </script>
> </head>
> <body>
> <form id="Form1" runat="server">
> <aspanel ID="Panel1" runat="server" Height="40px" Width=130
> Style="z-index: 101; left: 200px; position: absolute;
> top: 32px;">
> <asp:Button ID="Button1" runat="server" Font-Bold="True"
> Text="Send Message" OnClick="SendMail_Click" Width=110
> BackColor="#C0FFC0" BorderStyle="Outset"
> Style="z-index: 102; left: 20px; position: absolute; top:
> 20px; text-align: center;" />
> </aspanel>
> </form>
> </body>
> </html>
>



 
Reply With Quote
 
 
 
 
Pete
Guest
Posts: n/a
 
      09-05-2007
On Sep 5, 5:58 am, "Patrice" <http://www.chez.com/scribe/> wrote:
> Is this something you see yourself ? If not it could be that some users are
> just clicking multiple times on the button (for example double clicking by
> mistake). You could check the IIS log to see if the POST has been done
> multiple times (and possibly implement a verification so that it is cliekd
> once).
>
> "Pete" <(E-Mail Removed)> a écrit dans le message de news:
> (E-Mail Removed). com...
>
> > Hi - The following e-mail program runs completely successfully on my
> > PC, using VS2005, except that one click of the button seemingly-
> > randomly causes smtp.1and1.com to send either 1, 2, or 3 identical
> > copies of the message, one right after the other. Any ideas?

>
> > <%@ Page Language="VB" %>
> > <%@ Import Namespace="System.IO" %>
> > <%@ Import Namespace="System.Net" %>
> > <%@ Import Namespace="System.Net.Mail" %>
> > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/
> > TR/xhtml11/DTD/xhtml11.dtd">
> > <html xmlns="http://www.w3.org/1999/xhtml">
> > <head id="Head1" runat="server">
> > <title>Simple E-mail Program</title>
> > <script runat="server">
> > Private Sub SendMail_Click(ByVal sender As Object, _
> > ByVal e As System.EventArgs) Handles
> > Button1.Click
> > Dim message As New MailMessage()
> > message.Subject = "Trial"
> > message.Body = "<html><body>This is a <b>test</b> message.</
> > body></html>"
> > message.IsBodyHtml = True
> > message.From = New MailAddress("...")
> > message.To.Clear()
> > message.To.Add(New MailAddress("..."))
> > Dim client As New SmtpClient("smtp.1and1.com", 587)
> > Dim SenderLogInID As String = "..."
> > Dim SenderLogInPW As String = "..."
> > client.Credentials = New NetworkCredential(SenderLogInID,
> > SenderLogInPW)
> > message.ReplyTo = New MailAddress("...")
> > client.Send(message)
> > End Sub
> > </script>
> > </head>
> > <body>
> > <form id="Form1" runat="server">
> > <aspanel ID="Panel1" runat="server" Height="40px" Width=130
> > Style="z-index: 101; left: 200px; position: absolute;
> > top: 32px;">
> > <asp:Button ID="Button1" runat="server" Font-Bold="True"
> > Text="Send Message" OnClick="SendMail_Click" Width=110
> > BackColor="#C0FFC0" BorderStyle="Outset"
> > Style="z-index: 102; left: 20px; position: absolute; top:
> > 20px; text-align: center;" />
> > </aspanel>
> > </form>
> > </body>
> > </html>


Thanks for the reply. The test message is sent to myself at a
different e-address. The multiple messages are the only *multiple*
messages in my e-mail input box. I will try sending to a different
recipient.

 
Reply With Quote
 
Patrice
Guest
Posts: n/a
 
      09-05-2007
Ok it could be also :
- either the event happens seeveral times (for example using autoeventwireup
with the handles close)
- or it could be also some messaging rule that gets applied

Good luck

"Pete" <(E-Mail Removed)> a écrit dans le message de news:
(E-Mail Removed) om...
On Sep 5, 5:58 am, "Patrice" <http://www.chez.com/scribe/> wrote:
> Is this something you see yourself ? If not it could be that some users
> are
> just clicking multiple times on the button (for example double clicking by
> mistake). You could check the IIS log to see if the POST has been done
> multiple times (and possibly implement a verification so that it is cliekd
> once).
>
> "Pete" <(E-Mail Removed)> a écrit dans le message de news:
> (E-Mail Removed). com...
>
> > Hi - The following e-mail program runs completely successfully on my
> > PC, using VS2005, except that one click of the button seemingly-
> > randomly causes smtp.1and1.com to send either 1, 2, or 3 identical
> > copies of the message, one right after the other. Any ideas?

>
> > <%@ Page Language="VB" %>
> > <%@ Import Namespace="System.IO" %>
> > <%@ Import Namespace="System.Net" %>
> > <%@ Import Namespace="System.Net.Mail" %>
> > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/
> > TR/xhtml11/DTD/xhtml11.dtd">
> > <html xmlns="http://www.w3.org/1999/xhtml">
> > <head id="Head1" runat="server">
> > <title>Simple E-mail Program</title>
> > <script runat="server">
> > Private Sub SendMail_Click(ByVal sender As Object, _
> > ByVal e As System.EventArgs) Handles
> > Button1.Click
> > Dim message As New MailMessage()
> > message.Subject = "Trial"
> > message.Body = "<html><body>This is a <b>test</b> message.</
> > body></html>"
> > message.IsBodyHtml = True
> > message.From = New MailAddress("...")
> > message.To.Clear()
> > message.To.Add(New MailAddress("..."))
> > Dim client As New SmtpClient("smtp.1and1.com", 587)
> > Dim SenderLogInID As String = "..."
> > Dim SenderLogInPW As String = "..."
> > client.Credentials = New NetworkCredential(SenderLogInID,
> > SenderLogInPW)
> > message.ReplyTo = New MailAddress("...")
> > client.Send(message)
> > End Sub
> > </script>
> > </head>
> > <body>
> > <form id="Form1" runat="server">
> > <aspanel ID="Panel1" runat="server" Height="40px" Width=130
> > Style="z-index: 101; left: 200px; position: absolute;
> > top: 32px;">
> > <asp:Button ID="Button1" runat="server" Font-Bold="True"
> > Text="Send Message" OnClick="SendMail_Click" Width=110
> > BackColor="#C0FFC0" BorderStyle="Outset"
> > Style="z-index: 102; left: 20px; position: absolute; top:
> > 20px; text-align: center;" />
> > </aspanel>
> > </form>
> > </body>
> > </html>


Thanks for the reply. The test message is sent to myself at a
different e-address. The multiple messages are the only *multiple*
messages in my e-mail input box. I will try sending to a different
recipient.


 
Reply With Quote
 
Pete
Guest
Posts: n/a
 
      09-06-2007
On Sep 5, 7:56 am, "Patrice" <http://www.chez.com/scribe/> wrote:
> Ok it could be also :
> - either the event happens seeveral times (for example using autoeventwireup
> with the handles close)
> - or it could be also some messaging rule that gets applied
>
> Good luck
>
> "Pete" <(E-Mail Removed)> a écrit dans le message de news:
> (E-Mail Removed) om...
> On Sep 5, 5:58 am, "Patrice" <http://www.chez.com/scribe/> wrote:
>
>
>
> > Is this something you see yourself ? If not it could be that some users
> > are
> > just clicking multiple times on the button (for example double clicking by
> > mistake). You could check the IIS log to see if the POST has been done
> > multiple times (and possibly implement a verification so that it is cliekd
> > once).

>
> > "Pete" <(E-Mail Removed)> a écrit dans le message de news:
> > (E-Mail Removed). com...

>
> > > Hi - The following e-mail program runs completely successfully on my
> > > PC, using VS2005, except that one click of the button seemingly-
> > > randomly causes smtp.1and1.com to send either 1, 2, or 3 identical
> > > copies of the message, one right after the other. Any ideas?

>
> > > <%@ Page Language="VB" %>
> > > <%@ Import Namespace="System.IO" %>
> > > <%@ Import Namespace="System.Net" %>
> > > <%@ Import Namespace="System.Net.Mail" %>
> > > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/
> > > TR/xhtml11/DTD/xhtml11.dtd">
> > > <html xmlns="http://www.w3.org/1999/xhtml">
> > > <head id="Head1" runat="server">
> > > <title>Simple E-mail Program</title>
> > > <script runat="server">
> > > Private Sub SendMail_Click(ByVal sender As Object, _
> > > ByVal e As System.EventArgs) Handles
> > > Button1.Click
> > > Dim message As New MailMessage()
> > > message.Subject = "Trial"
> > > message.Body = "<html><body>This is a <b>test</b> message.</
> > > body></html>"
> > > message.IsBodyHtml = True
> > > message.From = New MailAddress("...")
> > > message.To.Clear()
> > > message.To.Add(New MailAddress("..."))
> > > Dim client As New SmtpClient("smtp.1and1.com", 587)
> > > Dim SenderLogInID As String = "..."
> > > Dim SenderLogInPW As String = "..."
> > > client.Credentials = New NetworkCredential(SenderLogInID,
> > > SenderLogInPW)
> > > message.ReplyTo = New MailAddress("...")
> > > client.Send(message)
> > > End Sub
> > > </script>
> > > </head>
> > > <body>
> > > <form id="Form1" runat="server">
> > > <aspanel ID="Panel1" runat="server" Height="40px" Width=130
> > > Style="z-index: 101; left: 200px; position: absolute;
> > > top: 32px;">
> > > <asp:Button ID="Button1" runat="server" Font-Bold="True"
> > > Text="Send Message" OnClick="SendMail_Click" Width=110
> > > BackColor="#C0FFC0" BorderStyle="Outset"
> > > Style="z-index: 102; left: 20px; position: absolute; top:
> > > 20px; text-align: center;" />
> > > </aspanel>
> > > </form>
> > > </body>
> > > </html>

>
> Thanks for the reply. The test message is sent to myself at a
> different e-address. The multiple messages are the only *multiple*
> messages in my e-mail input box. I will try sending to a different
> recipient.


That did it! Thanks much. All I had to do was remove the "Handles
Button1.Click" because I did not set autoeventwireup. A Microsoft
Feature, I guess. Thanks again.

 
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
Does return-by-value mean extra copies and extra overhead? mathieu C++ 3 09-04-2009 04:25 PM
Disabling reception of copies of my own messages sent to ruby-talk Alder Green Ruby 5 03-22-2006 04:29 PM
How do I create an Unordered List (UL) with ASP.NET? Nathan Sokalski ASP .Net 1 05-31-2005 07:36 AM
Using sendmail 2 copies get sent to each user mike Perl Misc 2 05-11-2005 05:26 AM
How many copies of a message can I send? larry Computer Support 7 01-31-2004 02:39 PM



Advertisments