473,836 Members | 1,573 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

Protected Sub btnSubmit_Click (ByVal sender As Object, ByVal e As
System.EventArg s) 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.BodyFor mat = MailFormat.Text

SmtpMail.SmtpSe rver = "smtp.my_server "

SmtpMail.Send(o bjMail)

litStatus.Text = "Sent!"

End Sub

End Class
May 29 '06 #1
1 3023
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.P age

Protected Sub btnSubmit_Click (ByVal sender As Object, ByVal e As
System.EventArg s) 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.BodyFor mat = MailFormat.Text

SmtpMail.SmtpSe rver = "smtp.my_server "

SmtpMail.Send(o bjMail)

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
4191
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 regular expressions easier to create and use (and in my experience as a regular expression user, it makes them MUCH easier to create and use.) I'm still working on formal documentation, and in any case, such documentation isn't necessarily the...
2
5226
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 running IIS on my home machine. My problem is that I need to upload this stuff to a webhosting place and register a domain and I'm not sure what to put as the smtp mail server value
7
1930
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 hidden portions of the form, used for setting the recipient address, sender address, etc... ...
6
2775
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 - and (!) also before the user has finished entering all the data in remaining text boxes. How do I do this? Please give a short code example if you know the answer. Many thanks. --
1
1540
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++ .Net Standard Edition 2003 I would like to include resources in the .EXE file. (Icons) I can do it the old fashioned way with a .rc file What I would like to do is use some other icons for buttons in a Windows Form. I can load them from separate...
4
1537
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 TextBox to be output as a textarea element. I have my constraints worked out. Its the feedback I am interested in implementing. <%= Clinton Gallagher
0
1511
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 but it is not working.so What is the solution.
4
2233
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 fields. These are UserName, UserEmail, UserCountry & Comments. It works well with all of those fields appearing in the body of an email that is sent to me. What I would now like is for the UserEmail field to appear in the "From:" field in the
1
1627
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 and clicks on submit button all the fields in the feedback form should be sent as the mail to the company who are providing feedback form can anybody help me out by giving me code?
9
2505
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 installing visual studio /dot product I will likely make sure no feedback
0
9813
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9664
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10539
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10584
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10248
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9367
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5815
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4446
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3108
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.