We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

client.BulkSend(MsgCollection)

Hi,

We are using client.BulkSend(MsgCollection) to send bulk emails. Is this sending emails asynchronously?

We are getting following error

A new exception ‘An asynchronous call is already in progress. It must be completed or canceled before you can call this method.’ Being thrown from the Send->BulkSend method of the Aspose code.

We are sending bulk emails from both web application and window service.

Are we missing anything?

Thanks

Ekta

Hello Ekta,

Could you please post some of your code to here for our reviewing?

Thanks,

Following is the code to send emails

Our smtp server is usually very busy. we have other bulk emails going out daily at scheduled time and we want to ensure all emails sent using ASPOSE gets send. Which is the most appropriate way to send emails Async?

public void Send(MailMessageCollection mailMessageCollection)
{
using (var client = new SmtpClient()
{
Host =
EnvironmentalConfigManagerHelper.
EmailSettings_EmailServer_EmailMessageServer
})
{
client.BulkSend(mailMessageCollection);
}

}

Awaiting for yr response…

Hello,

I cannot reproduce your problem locally. Could you please tell me the aspose.network.dll version? are you running on .net 2.0 or .net 3.5? what's your OS version 64bit or 32bit.

Thanks,

As suggested by you we got latest version of Aspose.dll version 4.8.1.2. We are using .net 3.5 and OS version is 32bit.

Can you suggest what is the best way to send email async. Do we need to added anything in webapplication so that it knows there is an async call made to send emails? We are also using Aspose in windows application.

Also does BulkSend() send emails asynchronously?

Found on web:

With just one attribute, by decorating the @Page directive with Async='true', developers can spawn one or more long-running operations, returning the main thread to ASP.NET to be used for other requests. This defers the completion of page processing until the asynchronous operations have completed and the page has the information it needs to complete the request.

Any input???

Hi,

BulkSend() method sends emails synchronously. For sending mails asynchronously, we have SmtpClientBulkSendAgent class. Please also find the attached C# sample application that sends bulk emails, monitors progress of mails sent and at the end gives you the list of email addresses to which email could not be sent.

In Windows application, are you using BulkSend() method? Please try using SmtpClientBulkSendAgent class and post here if it throws the exception.

To check this behavior at our end, could you please provide some more details how you are sending emails:

  1. Web page (sample code to send emails and frequency of using the web page)
  2. Windows application (sample code to send emails and frequency of using the application)
  3. Any Windows service for sending emails (sample code and schedule/recurrence of the service)
We will look into it detail and sort out the problem.

Hi,

I have posted sample code here. Both windows service and webpage uses following code.

<A href="</A></P> <P>Appro. more than 150-200 a day</P> <P>1) Webpage: Send meeting request to list of attendees. </P> <P>2)Windows service: every 15 mins. This service fetches all the emails from specified inbox and if required based on conditions send meeting requests to list of attendees.</P> <P> </P> <P>lemme know if u need more information</P>