Solved

Sending mails from Asp.net

Posted on 2014-07-31
3
333 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
imap mails 1 22
mail.To.Add 5 25
What Does This C# Code Block Do? 5 26
Sort GridView by ID Descending 1 9
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

776 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