If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > anybody know how to use a mail to button in asp.net

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-17-08, 20:51
aa_86 aa_86 is offline
Registered User
 
Join Date: Feb 2008
Posts: 49
anybody know how to use a mail to button in asp.net

hi i have created a contact us form is visual studio 2005, when i use a mail to button for the submitt butoon i keep getting errors when running the page

here is my table were will the code go and what is it:

<table style="width: 40%; position: static" bgcolor="#000000">
<tr>
<td style="width: 100px; height: 9px; background-color: silver; vertical-align: top; text-align: left;">
Name</td>
<td style="width: 100px; height: 9px; vertical-align: top; background-color: silver; text-align: left;">
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td style="width: 100px; background-color: silver; vertical-align: top; text-align: left;">
Email</td>
<td style="width: 100px; vertical-align: top; background-color: silver; text-align: left;" bgcolor="#000000">
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td style="vertical-align: top; width: 100px; background-color: silver; text-align: left; height: 99px;">
Message</td>
<td style="width: 100px; vertical-align: top; height: 99px; background-color: silver; text-align: left;">
<asp:TextBox ID="TextBox3" runat="server" Height="97px" Width="349px"></asp:TextBox></td>
</tr>
<tr>
<td style="vertical-align: top; width: 100px; height: 21px; background-color: silver;
text-align: left">
</td>
<td style="vertical-align: top; width: 100px; height: 21px; background-color: silver;
text-align: left">
<asp:Button ID="Button1" runat="server" Text="Submit" /></td>


<a href="mailto:myemail@hotmail.com">Submit</a>
i treid the following code but dont work
Reply With Quote
  #2 (permalink)  
Old 04-24-08, 17:51
gvee gvee is offline
www.gvee.co.uk
 
Join Date: Jan 2007
Location: UK
Posts: 10,156
Generally speaking a contact us form works in two ways.

1) using the anchor tag with a href attribute containing mailto:
This will open up a fresh little email with the information you specify as mailto attributes, but does not send it.

2) you fill in a form which is submitted, but contrary to popular belief, this does not send an email! This instead inserts the data into a database. The data can then be read by the people you are contacting, or indeed with ceertain DBMS a trigger event can fire which sends an email containing the stored details.

Hope this helps; feel free to ask questions as always
__________________
George
Twitter | Blog
Reply With Quote
  #3 (permalink)  
Old 04-24-08, 20:54
aa_86 aa_86 is offline
Registered User
 
Join Date: Feb 2008
Posts: 49
so do u know the code please?

the code ive specified above does not work
Reply With Quote
  #4 (permalink)  
Old 04-24-08, 20:54
aa_86 aa_86 is offline
Registered User
 
Join Date: Feb 2008
Posts: 49
also would you know of a valid validation rule or emaill address
Reply With Quote
  #5 (permalink)  
Old 04-25-08, 03:44
gvee gvee is offline
www.gvee.co.uk
 
Join Date: Jan 2007
Location: UK
Posts: 10,156
Regular expressions are the best way of validating email addresses (www.regexlib.com).

You already know the code for number 1, but there is a more detailed example here.

The second option involves you submitting and storing the data in a database; if memory serves you can already do this!

What DBMS are you using as the back end?

Ask yourself; is it really imperative for an email to be sent instead of you checking the submissions from the db?
__________________
George
Twitter | Blog
Reply With Quote
  #6 (permalink)  
Old 05-06-08, 10:03
noamsmadja noamsmadja is offline
Registered User
 
Join Date: Dec 2007
Posts: 21
dont they teach CSS around here? code looks awfull

Code:
<form method=post action=mailto:mail@server.com>
....
<input type=submit>
</form>

Last edited by noamsmadja; 05-06-08 at 10:08.
Reply With Quote
  #7 (permalink)  
Old 05-06-08, 10:33
Teddy Teddy is offline
Purveyor of Discontent
 
Join Date: Mar 2003
Location: The Bottom of The Barrel
Posts: 6,075
Quote:
Originally Posted by noamsmadja
dont they teach CSS around here? code looks awfull

Code:
<form method=post action=mailto:mail@server.com>
....
<input type=submit>
</form>
That's not going to work in asp.net. It's going to yell at you about having an invalid page when you go to postback. You can't have another form inside your "main" form that's been tagged with runat="server".
__________________
oh yeah... documentation... I have heard of that.

*** What Do You Want In The MS Access Forum? ***
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On