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