.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

Create Email Message and Send to Client For Review before Sending

Posted By:      Posted Date: September 23, 2010    Points: 0   Category :ASP.Net

Please read this post carefully. I am not looking to actually send an email using ASP.NET. 

I am looking for a means by which ASP.NET can create an Outlook MailItem and stream it to the client machine for the user to review prior to sending. I know that its possible to create files such as Word docs and Excel spreadsheets an then stream them, but I don't know how to do it with ASP.NET.

View Complete Post

More Related Resource Links

How to send or create non - repliable email in asp.net?

what settings do I need to set do make it non repliable email in SmtpClient object or how do I do it?

How To Save Pdf File In Client's Computer For Sending As Email Attachment


Hello everybody.

The subject of this thread is my question and I am really very sorry, I cannot brief it. I have generated the pdf file which contains text taken as input by various web-form and have saved it in my local drive then sended it to some email addresses. Now I want to know that how can I save it in client computer and send it to some email addresses provided by Client on demand?

I am failed to solve this problem as I don't know how to get INFORMATION OF CLIENT'S LOCAL DRIVE AS CLIENT MAY USES DIFFERENT OPERATING SYSTEM.

Any information will be very helpful to me.

Thank you.

Sending GridView in Email Message



How can I send GridView in Email Message.



Create Visual Studio Workflow to send Email from another address


Hello All,

I have a requirement where i need to build a visual studio for sharepoint workflow where i can send email from different address as we have on the code plex like this..

http://spdactivities.codeplex.com/(Send Email Extended - Enhaced version of the OOTB activity. Allows you to specify the sender. Also does not break links in body.)


I need to achieve the same using Visual studio workflow.

I am a new bie to Visual studio workflow.Can anyone point me to any  good article to achieve it.\

Thank you



Unable to send email with smtp client


I'm not able to get email working on my site. I have followed the instructions for this host. This should be very straightforward. Here is my current web.config.  

			<smtp deliveryMethod="Network" from=".com">
				<network host="localhost" port="25" userName=".com" password="" />
 Public Shared Function SendSimpleMail(ByVal fromAccount As String, ByVal toAccount As String, ByVal title As String, ByVal msg As String) As Boolean
            HttpContext.Current.Response.Write("FROM: " & fromAccount & " TO: " & toAccount & "TITLE: " & title & msg)
            Dim eMail As New System.Net.Mail.MailMessage()
            eMail.IsBodyHtml = True
            eMail.Body = msg
            eMail.From = New System.Net.Mail.MailAddress(fromAccount)
            eMail.Subject = title
            Dim SMTP As New System.Net.Mail.SmtpClient
            'SMTP.UseDefaultCredentials = False
            'SMTP.Credentials = New System.Net.NetworkCredential(".com&quo

How can I suppress Outlook 'warning' message when sending email via c#

I am currently using the follow to send email from rich client application - not sure if this is the best solution - lack of knowledge of SMTP authentication, SMTP server etc... and wanted to utilize Exchange.

Microsoft.Office.Interop.Outlook.MailItem mail = (Microsoft.Office.Interop.Outlook.MailItem)
new Microsoft.Office.Interop.Outlook.ApplicationClass().CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olMailItem);
Microsoft.Office.Interop.Outlook.ApplicationClass app = new ApplicationClass();
mail.Attachments.Add(strFileNameLocation, Microsoft.Office.Interop.Outlook.OlAttachmentType.olByValue, 1, strFileNametoAttach);

mail.To = to;
mail.Subject = subject;


Everytime a message has to be send, Outlook throws up a warning message and the user needs to 'authorize' the use of outlook. Is there anyway of suppressing the warning message. 

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%">

"Email message cannot be sent" error, but email still sending

I have SMTP configured corrently and can send emails with no problem. There is one place in my workflow that sends a reminder email if a task is not complete (after a Delay activity). When the reminder email is sent, I get the following error in the History Log: The e-mail message cannot be sent. Make sure the outgoing e-mail settings for the server are configured correctly. -- The weird thing is that the email still sends, and the workflow continues to run. I am using the SendMail activity rather than the SPUtility at this point (and the sendmail code used to put the email together is the same as a previous sendmail activity which works fine). Additionally, the error only happens on the first reminder, but all subsequent email reminders do not show the error and send just fine. I am also not able to catch the issue through the debugger. Any ideas?

Send Email with HTTP file attachment - Workflow is sending garbage in attachment



I'm having an issue with a customized workflow when I send an email with an attachment. I am using the "send email with http file attachment" that I have downloaded from CodePlex. Unfortunately all attachments that come through are full of garbage. This includes .jpg, .pdf, and .txt. From what I can tell with the .txt file is that its contents has been replaced with what appears to be the html of the list page. Both the .jpg and .pdf fail to open complaining about corrupt documents. All documents can be opened fine from within sharepoint. 

Can anyone of you guide me in this regard, as rest of my  workflow logic is working fine but this attachment issue is ruining the end result.


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.

Sending a File Using Email Helper in WebPages/Razor


Note: This is particularly with respect to Email Helper in WebPages/Razor. Please don't post links using System.Net.Mail object.

Following this tutorial: http://www.asp.net/webmatrix/tutorials/9-adding-email-to-your-website

Under "Sending a File Using Email" section what exactly is the code trying to do.

1: The SendFile.cshtml does not have any option to select file.

2: ProcessFile.cshtml is running fine. I am getting the email but no attachement.

I tried changing fileAttachment input to type="file" but not file is being sent to my email. I just get the message send in body.

Question: How exactly this file attachment works using Email Helper in WebPages.

create user wizard login error message dont show in a message box?




i am using create user wizard and capturing other information within content template when a new user

registers. Some of the textboxes are binded to required field validators.


there is a validation control on the page and ShowMessage box is True.

If they dont complete some of the text boxes then the message box pops Up with the error message.

It does not however include information errors like "User already exists" or Email address already exists

from the create user wizard membership  UserName and Password Textboxes


is it possilbe to hook all of these up so I get one message box with all errors including membership ones?




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.

Toolbox: Create Graphs, Send E-Mail, Spell-Check, and More


Turn boring data into stunning graphs, create, parse, send, and receive mail messages from code, and more.

Scott Mitchell

MSDN Magazine August 2007

DIME: Sending Files, Attachments, and SOAP Messages Via Direct Internet Message Encapsulation


Direct Internet Message Encapsulation (DIME) is a new specification for sending and receiving SOAP messages along with additional attachments, like binary files, XML fragments, and even other SOAP messages, using standard transport protocols like HTTP. In this article, the author explains what DIME is and how it differs from MIME encapsulation. A detailed description of the message format and how it is parsed, as well as working with SOAP and extending it with WSDL, is also included.

Jeannine Hall Gailey

MSDN Magazine December 2002

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"
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