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

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

Need code for send email from enquiry form

Posted By:      Posted Date: October 04, 2010    Points: 0   Category :ASP.Net

Dear All

I need code in C# and ASP.Net for send Email from enquiry form



View Complete Post

More Related Resource Links

Send an Email with User fields data entered in the form


Hi All,

          I have a form which have some user input fields(like textboxes,dropdownlists,textarea etc) fields and a submit button.

on click i need to send email with body contents as all the details entered by user in the form

Can anyone suggest how i should approach to this in sharepoint..

any code examples would be appreciated.


how to send email in asp.net with attachment c# code

 SmtpClient smtpClient = new SmtpClient();         MailMessage message = new MailMessage();         try         {             MailAddress fromAddress = new MailAddress(txtEmail.Text, txtName.Text);             // You can specify the host name or ipaddress of your server             // Default in IIS will be localhost              smtpClient.Host = "localhost";             //Default port will be 25             smtpClient.Port = 25;             //From address will be given as a MailAddress Object             message.From = fromAddress;             // To address collection of MailAddress             message.To.Add("admin1@yoursite.com");             message.Subject = "Feedback";             // CC and BCC optional             // MailAddressCollection class is used to send the email to various users   

how to send email in asp.net to any destination eg yahoo,gmail,hotmail etc c# code

hi i have try many code for sending email from msdn and many sites.but still i could do so. some code are here...   SmtpClient smtpClient = new SmtpClient();         MailMessage message = new MailMessage();           try         {             MailAddress fromAddress = new MailAddress(txtEmail.Text, txtName.Text);               // You can specify the host name or ipaddress of your server             // Default in IIS will be localhost              smtpClient.Host = "localhost";               //Default port will be 25             smtpClient.Port = 25;               //From address will be given as a MailAddress Object             message.From = fromAddress;               // To address collection of MailAddress             message.To.Add("admin1@yoursite.com");             message.Subject = "Feedback";               // CC

How to Create Web Form Using ASP.NET and Send Email


Hello All,

I've been in IT for a number of years on the Infrastructure side but I'm a complete newbie when it comes to ASP.NET programming (I literally started today).  I'm using Microsoft Web Expressions 2 to create a website and am used to using the regular HTML based forms to have the forms capture and email me the form data.  However, from a need to have more advanced Form Validation I've embarked on changing my forms over to ASP.NET.  All was going well when I seem to have hit a bit of a road block here.

I've managed to figure out the RegularExpressionValidator and RequiredFieldValidator Validation controls however I've now added an ImageButton that I want to be the form Submit button and to email me the form results once the user hits Send.  But from the examples I've found online I'm still stumped on how to implement this.

Below is the form code from the page.  My site is hosted with 1&1.com and I just want the form info to come to me at my email address, preferably in HTML format.

Can someone assist with this?  Thanks in advance.


<form id="ContactUs" runat="server">
     <table style="width: 100%">

Infopath send form as email

I have created a infopath form and it is published to a sharepoint 2007 with form services.
We use a support system, that only support plain/text, how can I convert the output to plain/text ?
When infopath automatically converts the form to plain/text, i does not look good.
I would like a format like:

Field1: Value1
Field2: Value2

And another thing, is it possible to use the users email as sender, and not the email setup in our sharepoint environment ?
Every email sent from sharepoint / infopath, is sent from: noreply@domain.tld
I would like: user@domain.tld (user = the user who is logged in)

Jakob Olsen

Automatically send custom email to upon InfoPath form submission


I would like to have an InfoPath form automatically send out and email upon submission.

I would like the email to be comprised of content from the fields of the form. For example:


To: <data from the "Manager" field>

From: <data from the "Requester" field>

Subject: You have a request for <data from the "Project Name" Field>.

Body: Hi <Manager>,

I would like more information on <Project>

-< Requester >


Is this possible? It doesn't need to be part of a workflow, we just want the relevant manager aware of the request.

Send Attachments from a form to email


Have a transport form (infopath 2007) that give users an easy web based ability to upload document for compensation. So I created the InfoPath form and added a repeating "File-Attachment" control to the form and the form just sends a email to a specific recipient  

The form are showed in a xmlformview webpart on a transport.aspx page 

It sends out a email to the recipient - but the attachments aren't delivered with the email.

How can I accomplish that?

How to send an email to Supervisor (field in the form) after New Item in a list is created?


I have user who creates a record and User's Supervisor, who need to get notification about new record (different Users have different Supervisors and they input them manually into field when create a new record).

(Users I've mentioned are domain users with emails assigned to them and we use Outlook that is integrated with our sharepoint)


1) I've tried to create a workflow in Sharepoint Designed (as described here: http://social.msdn.microsoft.com/forums/en-us/sharepointdevelopment/thread/2A525E2F-2407-42C9-AB9D-B5FB609B34B5) , but there I can choose only concrete email address (I need it to be populated from the field on the form).

I think the workflow can be configured somehow to send an email to user from a field, but I don't know how. 


2) I've created a new view with filters by Supervisor and configured Alerts for the view, but it is too complicated for all Supervisors to do that. (just not the best solution)


any ideas? 

Cannot send custom form email



I have an issue sending emails with custom message class. I am using WebDav and I don't think it is a problem with the code. My code puts an email into the drafts folder, changes the message class to a custom class and moves it to DAVSubmissionURI (which sends the email). Why I am so sure that it is not an issue with the code is if I remove the piece of code which changes the message class it sends the email but if I put it back I can see it in the sent items but the email is not received by the recipient.

Many Thanks,


Send Email from SQL Server Express Using a CLR Stored Procedure

One of the nice things about SQL Server is the ability to send email using T-SQL. The downside is that this functionality does not exist in SQL Server Express. In this tip I will show you how to build a basic CLR stored procedure to send email messages from SQL Server Express, although this same technique could be used for any version of SQL Server.

If you have not yet built a CLR stored procedure, please refer to this tip for what needs to be done for the initial setup.

How to send an email with information in query string


First I will say I googled (Binged to make Bill happy) for this but could not find anything, perhaps I am not stating what I need correctly;

I have a website that a customer creates orders (for a printing company) and after the order, I would like to email the customer a link to view the status of their order;

I need to send the CustomerID in the link so on the returning page if a CustomerID is detected in the querystring, I "auto login" the client and open the "Dashboard" for the order page for that customer.

Can anyone point me in the right direction as to how to send the link and how to parse the querystring to get the values from the link;

Thank you if you can point me in the right direction.

Send email throught proxy



i want to send a mail via my mvc application hosted by cassini ,but  i access to the internet connexion throught proxy

i add this lines on my web config :

    <defaultProxy  enabled="true" >
      <proxy proxyaddress=""/>
        <network />
and in my code i have :
 MailMessage mail = new MailMessage();
             mail.From = new MailAddress("yyy@xxx.fr");
                    mail.Subject = "Test";

                    string Body = "Hi, this mail is to test sending mail" 
                    mail.Body = Body;
                    mail.IsBodyHtml = true;
                    SmtpClient smtp = new SmtpClient("");
                    smtp.Port = 25;

                catch (Exception ex)
                    string exep = "Send Email Failed." + ex.Message;

 i have un exception :"Unable to connect to the remote server"

Trying to send email using Sharepoint Designer 2007 workflow and email enabled list


I have a a list that recieves email. I have few fields that shows me the originator: "E-Mail From" and "E-Mail Sender".

I am trying to create a workflow that will generate an auto reply to the originator but the SPD fails to recognize the email address in these two fields. It's either truncating part of it or uses the html ( href=mailto:Demo@DemoSomething.com) in the To field.

Thank you,


spd2007 - basic form and email


I'm using spd2007 and have created a very basic form to collect data. I've also set it up to send off an email. When I go to the moss2007 site and use the form it appears to be working fine. However, I never receive an email from the workflow. I checked my logs and don't see anything logged about the email not working.

Any suggestions?

I can't send email from workflow.


I’ve got strange problem. I’ve created workflow with Visual studio 2008 which works fine. If workflow create task user gets email with alert and it works  - user gets email.   The problem is that I would like to use Workflow component: “SendEmail” for some cases. And if I enter directly into component email address for field: “TO” the message will be delivered. But if I use simple code with the same email address for field ”TO” it doesn’t work (field TO is empty now).

private void sendEmail_ExecuteCode(object sender, EventArgs e)



Infopath form return XMl code during workflow task


1.     Review 7777.xml.

2.     Perform the specific activities required for this task.

Use the Edit this task button to mark the task as completed. (If you cannot update this task, you might not have access to it. Click here to request access.

Extracting Infopath form templates (with code behind) from a farm



I am in the middle of a migration of MOSS 2007 on server 2003 R2 to server 2008 r2, to be in the position to migrate to SP 2010. I am trying to extract form templates (with code-behind) from the old farm to the new farm. I did not set this farm up myself, so I would have copies of everything that was deployed to the farm, but now I don't. I have tried grabbing the .xsn from the Form Templates form library, and the form comes over, but no code behind, it says, The VB or C# project for this form template cannot be found. I have also tried extracting the solution files, and changing the file ext to .cab and opening the file up, only to find nothing very useful.

I need to extract and open the code up because I believe one of the forms that sends emails dynamically, is pointing to an old exchange server, because the emails are not getting through, and the exchange server was recently changed.

Any ideas would be much appreciated.


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