Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 357
  • Last Modified:

Sending mails from Asp.net

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
yadavdep
Asked:
yadavdep
  • 2
1 Solution
 
Jens FiedererCommented:
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
 
Jens FiedererCommented:
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
 
Jaime OlivaresCommented:
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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now