.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

asp mail form and calculation

Posted By:      Posted Date: September 07, 2010    Points: 0   Category :ASP.Net
Hi All,I have never used asp before and the owner of a site I am working on requires that everything is done in asp. I have a very simple working version in php. Any help I can get would be great, even if I were to be pointed in the right direction.Code:<?php$to = "email@email.com";$subject = "Email from Web Site";$email = $_POST['email'];$jugs= $_POST['txtJugs'];$coolers= $_POST['txtCoolers'];$spent = ($jugs*6 + $coolers*10)*12;$savings = ($spent*30)/100;$msg = "Email: ".$email."\n Jugs: ".$jugs."\n Coolers: ".$coolers."\n Spent: ".$spent."\n Savings: ".$savings;$extra = "From:$email\r\nReply-To:$email\r\n";mail($to,$subject,$msg,$extra);print "We've calculated that you spend approximately $".$spent." annually on drinking water. <b>Quench can save you approximately $".$savings."</b>. Please <a href='../contactus/index.htm'>contact us</a> for more information.";?>

View Complete Post

More Related Resource Links

How to send form result to e-mail from aspx page ?

Hello , I'm stuck with this problem. I have aspx page , (.net 4 , web form ) on this page I have 3 text fields, 3 radio buttons groups, and 6 checkboxes, and button ( submit) . I'm trying to send data to e-mail using button event. The problem which I found that CheckBoxes giving boolean, I want transfer it to Yes or Not. Radio button giving boolean or integer as well. And another problem, I want to send only part which has been answered. empty ( NULL ) field should be ignored. If you can point me in right direction could be cool. What the best way for this? Thank you!

Sending information in e-mail from a fillable form


I have created a page for filling information, when anyone fills out the form, the information gets e-mailed to all the recipient's e-mail addresses that are mentioned in the code of the page.

I have written the code which is working fine but when i fill out the information in the form, the information is sent to all the 3 e-mail addresses i mentioned in the code, but all 3 recipients of this information can see other recipient's name and address in the "TO " field of their mailbox.

Is it possible to hide other recipients and only show the e-mail address which will be specific to that recipient ?

Here's my code:

using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Net.Mail;
using System.Collections.Generic;
using System.Net;

namespace NopSolutions.NopCommerce.Web

    public partial class Careers : BasePage
        protected static readonly MailAddress from = new MailAddress(MessageManager.AdminEmailAddress, MessageManager.AdminEmailDisplayName);
        protected static readonly List<Ma

Intigrate E-mail part with my infopath form

Hi I am using info path 2010 and I have the scenario that once a job seeker fill the form and submit to sharepoint document library after that when admin open it and check it he/she can directly send an Email from that I have the code but I want to use the templates so if you have any idea please help me 

Intigrate E-mail part with my infopath form

Hi I am using info path 2010 and I have the scenario that once a job seeker fill the form and submit to sharepoint document library after that when admin open it and check it he/she can directly send an Email from that I have the code but I want to use the templates so if you have any idea please help me 

The specified string is not in the form required for an e-mail address

I have searched and searched and searched for an answer to this problem...

I have been using the System.Net.Mail namespace for quite a while to send emails from my websites. A problem occurs though on certain (VALID) email addresses. For example, when the name field of the email address has a dot (.) in it (example: my.name@email.com), an exception is raised when this address is added to the TO property of the MailAdddress object. It seems the dot between my and name causes the exception.

Please note that these are valid email addresses, but the MailAddress object considers them to be invalid.

Any suggestions/workarounds?

Error Message: The specified string is not in the form required for an e-mail address.
Stack Trace: at System.Net.Mime.MailBnfHelper.ReadMailAddress(String data, Int32& offset, String& displayName)
at System.Net.Mail.MailAddress.ParseValue(String address)
at System.Net.Mail.MailAddress..ctor(String address, String displayName, Encoding displayNameEncoding)
at System.Net.Mail.MailAddress..ctor(String address, String displayName)

Change e-mail for form-based user


Hi, all.

I create some users with wrong e-mail, some without e-mail. When I need to give them true email address I encountered a problem: i can't do this.

I trying to change email in sql base aspnetdb, wss_content_webapp, then restart sql, restart IIS, restart server - nothing helps me.

I tried to go to user - my settings - change and didn't see e-mail form to change.

I don't need MySite collection.

Question is - how i can change all information of user when user already exist. When i create user with writing same information - all information picking up.

Include a static hyperlink in infopath form mail message



i know i can add a hyperlink in an infopath form. but can this be done in an email message?

i want to submit a form using email. but i dont want the form to be attached to the mail. instead i want to use the hypelink.

can i do this?

How do I embed an InfoPath form in the body of an e-mail and have the data go to a SharePoint list w

I've managed to create a form in InfoPath with all the required fields.  I can publish this to be embedded in the body of an e-mail as long as it is not linked to the SharePoint list.  I can also publish the form directly in the SharePoint list so that when you 'Add document' the form appears and can be filled out.  However, I can't publish the form to an e-mail (embedded in the body) and have a end-user submit the information to a SharePoint list.  Is this possible?  If so, what steps am I missing to allow it to happen?  Thanks!

How to post from a form to a Database and E-mail



I have a page up and running with a form that when you click submit it will either update the database (form action="") or forward you to a confirmation page (action=email.cshtml) both with method="post"

They both work on their own, it'll either update the database or successfully send out an e-mail, but not both which is what I need

How can I set this up so it will do both instead of one or the other?



How to calculate childs age,but when i enter childs age as '03/27/2007' it returns 3 years where as actual age is 2 yr 11 months

JQuery Validate plugin to validate a ASP.NET Form

The first time I used the JQuery Validate plugin, it did not work at all, see JQuery Validate odd behaviour with the ASP.NET Script Manager for reason, but perseverance and stubbornness prevailed and I finally created my first JQuery validated ASP.NET Forms contact form.

How to use getElementById to get the elements in a form

There are many ways of accessing form elements, of which the easiest is by using the cross-browser W3C DOM document.getElementById method. Before we learn more about this method, it would be useful to know something about the Document Object Model (DOM), the concept of HTML nodes or elements, and the concept of containers.

Each time you load an HTML page, the web browser generates an internal representation of the page in the form of an inverted tree structure. Let us look at a simple form. We will use this form later to demonstrate the use of the getElementById method.

calculation, field and map traverse adjustment, and coordinate transformation

Free Pocket PC land surveying software -- COGO calculation, field and map traverse adjustment, and coordinate transformation -- for students and professionals.

Form view in ASP.NET


hi all...!
i have a database and i create a form with button edit,delete, New Registration..using Formview in asp.net..
everything was working good...

And i write SQL statement to get New ID number into dropdownlist/TextBox when i click button "New Registration".

i can get new(next) ID number after read database
it's also working good

Now i want change it to get ID which was deleted from table and replace the ID with new record...what i need is when i click "New Registration" i want get deleted "ID" first and then go to new record ID...

my code is here:-it working for get next ID after read database.

FROM Table1
AS boon WHERE PANG &gt;300000

form feild hints are not displaying for textboxses inside create user wizard?



I'm using following JS code to display input hint box besides the textbox whenever that asp.net textbox receives focus. 

I'm doing this for a registration form and all of the textboxes are inside the asp.net create user wizard control.

<script type="text/javascript">
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {

function prepareInputsForHints() {
	var inputs = document.getElementsByTagName("TextBox");
	for (var i=0; i<inputs.length; i++){
		// test to see if the hint span exists first
		if (inputs[i].parentNode.getElementsByTagName("span")[0]) {
			// the span exists!  on focus, show the hint
			inputs[i].onfocus = function () {
				this.parentNode.getElementsByTagName("span")[0].style.display = "inline";
			// when the cursor moves away from the field, hide the hint
			inputs[i].onblur = function () {
				this.parentNode.getElementsByTagName("span")[0].style.display = "none";

How to pass value to another form


Dear experts,

                     I have QuoteNumber filed in Db.aspx(ddquote.txt) i want to pass this QuoteNumber values(values should to another web form/page i.e. mail.aspx when i click mail button, Message should supposed to display in textbox(txtQuote.txt) of mail.aspx form/page is "You are sending "QuoteNumber"  quotation to "MailID", Thanks.




ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend