Solved

Sending mails from Asp.net

Posted on 2014-07-31
3
336 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
  • 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 200 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

685 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