Unordered extra copies of e-mail message sent

P

Pete

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>
 
P

Patrice

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).
 
P

Pete

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).

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.
 
P

Patrice

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" <[email protected]> a écrit dans le message de
(e-mail address removed)...
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).

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.
 
P

Pete

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" <[email protected]> a écrit dans le message de (e-mail address removed)...



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.
 

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

No members online now.

Forum statistics

Threads
473,836
Messages
2,569,750
Members
45,545
Latest member
rapter____0

Latest Threads

Top