Unordered extra copies of e-mail message sent

Discussion in 'ASP .Net' started by Pete, Sep 5, 2007.

  1. Pete

    Pete Guest

    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">
    <asp:panel 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;" />
    </asp:panel>
    </form>
    </body>
    </html>
    Pete, Sep 5, 2007
    #1
    1. Advertising

  2. Pete

    Patrice Guest

    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" <> a écrit dans le message de news:
    ...
    > 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">
    > <asp:panel 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;" />
    > </asp:panel>
    > </form>
    > </body>
    > </html>
    >
    Patrice, Sep 5, 2007
    #2
    1. Advertising

  3. Pete

    Pete Guest

    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" <> a écrit dans le message de news:
    > ...
    >
    > > 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">
    > > <asp:panel 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;" />
    > > </asp:panel>
    > > </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.
    Pete, Sep 5, 2007
    #3
  4. Pete

    Patrice Guest

    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" <> a écrit dans le message de news:
    ...
    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" <> a écrit dans le message de news:
    > ...
    >
    > > 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">
    > > <asp:panel 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;" />
    > > </asp:panel>
    > > </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.
    Patrice, Sep 5, 2007
    #4
  5. Pete

    Pete Guest

    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" <> a écrit dans le message de news:
    > ...
    > 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" <> a écrit dans le message de news:
    > > ...

    >
    > > > 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">
    > > > <asp:panel 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;" />
    > > > </asp:panel>
    > > > </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.
    Pete, Sep 6, 2007
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Curt_C [MVP]
    Replies:
    5
    Views:
    354
    Karim
    May 19, 2004
  2. Replies:
    0
    Views:
    1,329
  3. mathieu
    Replies:
    3
    Views:
    582
    Bo Persson
    Sep 4, 2009
  4. Alder Green
    Replies:
    5
    Views:
    85
    Alder Green
    Mar 22, 2006
  5. mike
    Replies:
    2
    Views:
    77
Loading...

Share This Page