473,408 Members | 1,735 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

feedback form using ASP.NET and VB.NET

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
May 29 '06 #1
1 2968
Sounds like you've managed to get your click event wired up twice. Try
setting AutoEventWireup="false" in the ASPX @Page declaration.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Mario Krsnic" wrote:
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

May 29 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Kenneth McDonald | last post by:
I'm working on the 0.8 release of my 'rex' module, and would appreciate feedback, suggestions, and criticism as I work towards finalizing the API and feature sets. rex is a module intended to make...
2
by: Mindful_Spirit | last post by:
I'm trying to set up a basic email feed back form like this, and was wondering about some basic configuration settings. I have used code from this website. I have it working just fine. I'm...
7
by: Armand Karlsen | last post by:
On one page of a site I'm doing for a college project, I have a feedback form: http://www.zen62775.zen.co.uk/Test/contact/contact_feedback.html All parts of this page validate, except for the...
6
by: Patrick De Ridder | last post by:
I use a form with text boxes. The user enters data in the text boxes. The data is written away to a file. I wish to give the user feedback on the form, before the data is written away to the file -...
1
by: Sam Smith | last post by:
Dear All I would be really grateful if someone would help me. I have scoured the docs and the web for this I am writing a VC++ application, using .NET and Windows Forms. I am using Visual C++...
4
by: clintonG | last post by:
I'm wondering if anybody has figured out how to implement this feedback methodology which displays Characters Remaining when using the TextBox TextMode="MultiLine" attribute which will cause the...
0
by: vijay | last post by:
hello friends, I have done one website by using frontpage 2005 and i have done the feedback form.Now I want to send this feedback form to email id.I have used mailto: in form tag...
4
by: ianbarton | last post by:
Hello all I am trying to setup a feedback form on my webpage using some script provided by my ISP. I really don't know a lot about PHP and it's syntax etc. The feedback form only has 4...
1
by: lali | last post by:
hi everybody, i am doing a project and i have strucked in middle of my code usiong asp. the problem is, in the feedback form there are many fields which are manidatory.when an user fills the form...
9
by: gs | last post by:
the feedback for the install of c#2008 places 97 to 99% cpu load for way too long on athlon x64 3800+ PC. 3/4 an hour later its only about 80% complete, continuing with 98% CPU load! Next time...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.