feedback form using ASP.NET and VB.NET

M

Mario Krsnic

Hello!
I made a feedback form using ASP.NET and VB.NET. It works, but I receive
allways two mails from server instead of one. Why?
Thanks for every idea!
Mario
Here the code:

Imports System.web.Mail

Partial Class _Default

Inherits System.Web.UI.Page

Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles btnSubmit.Click

Dim objMail As New MailMessage()

objMail.From = txtFrom.Text

objMail.To = my_mail_address@my_domaine.tld

objMail.Subject = txtSubject.Text

objMail.Body = txtBody.Text

objMail.BodyFormat = MailFormat.Text

SmtpMail.SmtpServer = "smtp.my_server"

SmtpMail.Send(objMail)

litStatus.Text = "Sent!"

End Sub

End Class
 
G

Guest

Sounds like you've managed to get your click event wired up twice. Try
setting AutoEventWireup="false" in the ASPX @Page declaration.
Peter
 

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,754
Messages
2,569,522
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top