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

Post New Web Links

Sending Asynchronous emails from Asp.Net Web pages

Posted By:      Posted Date: September 03, 2010    Points: 0   Category :ASP.Net
Hey Guys, Here is my situation and hopefully someone could guide me in the right direction. I have a shared or static class in my website (App_Code folder) which has static methods to send emails asychronoulsy. So whenever there is an exception in any of my pages or classes I call these methods to send an email to support asynchronously. Now when there is an exception in a page, to route that exception asynchronously I need to have Async = "true" for that page. I have more than 50 pages and I don't want to set Async= "true" on every page as I read that it affects performance. So I was wondering if there is any way I could send emails asynchronously without having to set async = "true" on every page. Thanks for your time,   Uday.    

View Complete Post

More Related Resource Links

Cutting Edge: Revisiting Asynchronous ASP.NET Pages


If you need to scale up an existing Web application, you should first look to asynchronous operations, says Dino Esposito. He explains how new features coming in ASP.NET MVC 2 make this easier.

Dino Esposito

MSDN Magazine April 2010

Wicked Code: Asynchronous Pages in ASP.NET 2.0


ASP.NET 2.0 is replete with new features ranging from declarative data binding and Master Pages to membership and role management services. But my vote for the coolest new feature goes to asynchronous pages, and here's why.

Jeff Prosise

MSDN Magazine October 2005

smtp server 5.1 in xp not sending emails


hi iam using asp.net 2.0 with c#.net.

in my application when client completes its shopping email will goes to user this works fine when there is internet connection is working fine,
if  there is some problem  in internet connection if one mail stops then all the mails will be stopped even now internet works fine,

how to resend the emails using smtp server, is there any option to resend the emails automatically when internet works fine.

can you give example which helps me.

Error on sending Outlook emails

Hi,I am trying to send an email using Outlook in my application. When I run the application in my local machine , it works fine and sends the email using my outlook address. But when I depolyed it onto our server, which is a  Windows Server 2008, it throws an error:Description:            Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80080005.Date/ time:            20100908_03:51:48FullErrorOutput:            System.Runtime.InteropServices.COMException (0x80080005): Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80080005.   at _Default.SendWelcomeEmails(String email)   at _Default.btnGrant_Command(Object sender, CommandEventArgs e)   at System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e)   at System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument)   at System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)   at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)   a

Asynchronous requests in WCF service implementation, any support like ASP.NET asynchronous pages?

What if my WCF service implementation executes some IO operation which may take a while, say 5 seconds.  Ideally I would like to return the thread executing this service request back to the pool to handle other incoming requests while I'm waiting on the IO.  ASP.NET introduced asynchronous pages to address this issue (http://msdn.microsoft.com/en-us/magazine/cc163725.aspx).  This allows for much better resource use and improves the responsiveness of the server.  Does the WCF hosting service allow for something similar? Thanks, Nick

sending bulk of emails


Hello guys

   I have a situation where i have to send around 50,000 emails with around 90kb attachment, each attachment will be generated by crystal reports then sent by email to the subscriber, what is the best practice for this? thanks alot

sending muliple html pages in single email


want to send muliple html pages in a email in vb.net

Sending Digitally Signed emails using C#

Hi All,

    I have a requirement of sending a digitally signed email using C#,ASP.net. I tried it several ways and atlast using ASPEmail and ASPEncrypt i was able to access certificate but iam getting the mail address as the name of the certificate holder. Iam unable to find how to read the email address from the certificate. Any support will be appreciated. Thanks in advance.
phani kumar ---help me out

Workflow keep sending emails!



i customized a workflow using SPD and attach it with a List, the trigger was when a specific item field changed, send an email.

the problem is the workflow keep sending the emails repeatedly . i deleted the list item, i even deleted the workflow itself from the Settings >> Workflow settings, i cleared the SPD workflow cashe, and it still sending the emails!

appreciate your help..

Sending Emails


Hi all.

I'm trying to solve a problem about sending emails from a contact form.  I have the first script that i'm using it sending but only to my external account and I got this on that sends but i'ts in vb and I'm not able to attach a style sheet to it. could any one tell me a code that I can use to replace the VB version.  Or. can translate the VB into C#

This will be appreciated.


this is my web config file
			<smtp from="send@myservices.com" deliveryMethod="Network">
				<network host="mail.myservice.com" port="25" userName="send@myservices.com" password="service" />

this is my C# backend code.

  protected void Button1_Click(object sender, EventArgs e)
            SmtpClient smtpClient = new SmtpClient(); MailMessage message = new MailMessage(); try
                MailAddress fromAddress = new MailAddress(Email.Text.ToString(), this.Contname.Text.ToString());
                message.From = fromAddress;//here you can set address   

Testing Emails Sending (SMTP) under IIS7 Express (WebMatrix)


Hi there,

I don't have web server account yet so I must test my applications with the Web Development Server under VS 2010 with C# but I read that I couldn't send emails under that server but I also read that I can send email with IIS7 Express and that's the main reason why I've install Webmatrix. Maybe someone can confirm this.

So for the moment I am redirecting my emails into a local folder and it is working perfectly.

Here is part of the code I've add to the Web.Config for doing that.

      <smtp deliveryMethod="SpecifiedPickupDirectory">
        <specifiedPickupDirectory pickupDirectoryLocation="D:\Temp"/>


As you can see I am redirecting the emails to the D:\temp

The following code for sending emails comes 
from the videos of JOE STAGNER at Microsoft
but beware there is a few typing errors in 
his video like missing > " 


Sending emails to user from people picker - non-exchange user


Hi all another issue @ hand, our production environment is in co-existence between exchange and domino, mail flow is working fine between them as we do directory sync. now for the juicy part, when sending email notification from sharepoint, it users people picker to pick up users synced from AD. To Exchange users it goes through without issue, but to Domino users it does not, even though the AD account has the email field in account been tabulated. For Domino users we have AD account and Mail contact for mail fow. Can someone help me understand why is it so when even with the email field been tabulated in the AD accoutn for the Domino users, email notification does not go through, but when the email address of the users is hard-coded into the notification the email goes through.

SharePoint custom workflow sending duplicate task assigned emails


I'm running into an issue where a custom sequential workflow I've built in VS2010 is sometimes sending duplicate emails to the user to whom created tasks are assigned. Note: this is a Site workflow not a List workflow, in case that matters.

It's a pretty simple flow: i've got an InfoPath initiation form, and am using an OnWorkflowActivated workflow action to take the data from the form and popluate some workflow variables, then I've got a CreateTask workflow action that sets the AssignedTo value on the Task Properties, along with some other Task Property values.

The task gets created successfully in the task list, and in most cases a single email goes out to the person the task is assigned to. However, sometimes (and I haven't been able to figure out what is causing the difference) up to 3 duplicate messages are sent out, as well.

I've seen other posts in the forums where this sort of thing is happening with OOTB workflows ( this thread, for example: http://social.msdn.microsoft.com/Forums/en/sharepointworkflow/thread/66f94e07-a690-4166-aaeb-b7f5bc424fe4?prof=required). However, duplicate tasks are not being created (unless I'm missing the duplicates somehow -- they're not showing in the task li

Asynchronous Pages

The article Asynchronous Pages was added by codenickel on Saturday, October 30, 2010.

Asynchronous Pages: Objective: Improves theScalability of website & Efficient design for time consuming process.Note: It should not be confused with Asynchronous request from Client side.AJAX used to improve the end user interface,where as Asynchronous

SQL Server Job Generates Multiple Emails and Pages


In SQL Server 2005 I have set up a job with an email/pager alert via Database Mail.  It is working, but I am getting about 10 emails/pages every time the job runs.  Any ideas on why this is occurring?


using asynchronous pages to perform asynchronous data binding


hi all,
I have a question about using asynchronous pages to perform asynchronous data binding. I searched google and found this sample code here http://msdn.microsoft.com/en-us/magazine/cc163725.aspx
("Wicked Code: Asynchronous Pages in ...")

public partial class AsyncDataBind : System.Web.UI.Page
    private SqlConnection _connection;
    private SqlCommand _command;
    private SqlDataReader _reader;

    protected void Page_Load(object sender, EventArgs e)
        if (!IsPostBack)
            // Hook PreRenderComplete event for data binding
            this.PreRenderComplete +=
                new EventHandler(Page_PreRenderComplete);

            // Register async methods

jQuery $(document).ready() and ASP.NET Ajax asynchronous postback

Many call it the ASP.NET jQuery postback problem, but using the technique below should make it no problem anymore. $(document).ready() isn't called after an asynchronous postback. What this means? You lose the functionality that should be executed within $(document).ready() after an UpdatePanel rendered its contents after an asynchronous postback.
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