Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Sending mails from Asp.net

Posted on 2014-07-31
3
Medium Priority
?
354 Views
Last Modified: 2014-08-04
I am working on a Asp.net 4.0 application.
In it there is a feature where a loggedIn user can invite other people to join him in this application.
For this user needs to enter the email address for people he wants to invite.
This can be 1 or 1000.

Application need to send emails to these people.
Now I can not write my mail sending code  on the main thread and let the user wait for response till every single mail is sent.

What other approaches I can apply here to send mail and let the user other tasks on the application After he clicks on the Send invitation button.
0
Comment
Question by:yadavdep
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 23

Expert Comment

by:Jens Fiederer
ID: 40232779
You just about answered your own question....you can start another thread and pass it the addresses of emails to send.

One disadvantage with that approach is that if the application is terminated, that thread might not have completed all of its work, so a separate process to do this is probably a better option.
0
 
LVL 23

Expert Comment

by:Jens Fiederer
ID: 40232786
Using
http://msdn.microsoft.com/en-us/library/h6ak8zt5(v=vs.110).aspx

you could start that task with information on its command line, or if this really could be 1000 addresses it might be better to write them to a file and let the task read the file, send the email, and dispose of the file when it is done....
0
 
LVL 55

Accepted Solution

by:
Jaime Olivares earned 800 total points
ID: 40233171
for sending hundreds of emails per day I suggest you to use a service as SendGrid (sendgrid.com). It offers 200 daily mails for free and 40,000 monthly for $10. It won't consume too much time to deliver 1000 emails to SendGrid for dispatching.
Sending hundreds of emails may overload your web/sql/mail server
0

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question