Solved

Sending mails from Asp.net

Posted on 2014-07-31
3
326 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now