How do I send bulk emails (around 250 emails at a time) without blocking the current thread so that the emails are send quickly?
I have developed a social networking website at
http://www.fineartsbaroda.com . I want a functionality that whenever an artist uploads an artwork, an email should go to all the members.
Currently when someone uploads the artwork, it takes a very long amount of time for sending all these emails.
Are you sending the mails one by one to all these 250 people ?
If yes, that is why this much time is taken. Could you try to add all the recepients with a semi colon delimiter rather than sending the mail to all of these people one by one. If that doesnt workout, try to add them all in the CC property.
I am sending this emails one by one to all. The reason is that these emails provide users with the ability to automatically login to the system. so each email has dynamic text with dynamic link.
How do I send bulk emails (around 250 emails at a time) without blocking the current thread so that the emails are send quickly?
I hope you know how to send an email using Asp.net.
If you want to send bulk email you could get comma delimited string of recipients from database and assign that list of recipients in BCC field and To field will have your own Email Id. You can create batch of recipients (let's say 50) and send it after
predefined time interval so that SMTP server doesn't include your email id in Black list and your email won't be considered spam. :)
I hope it makes sense :)
IloveAjax
Currently when someone uploads the artwork, it takes a very long amount of time for sending all these emails.
When user clicks to send an email, you could just retreive all the recipients from DB and use in function that will be executed until mail is sent to all the receipients. :)
Unfortunately, I am on a shared hosting service, which doesn't allow me to run schedulers and services on the server. I am learning about the Amazon cloud computing, and planning to move to amazon server, but I am still not comfortable with it.
Is there anyway to find out a solution with this limitations.
Unfortunately, I am on a shared hosting service, which doesn't allow me to run schedulers and services on the server.
I wish that you should have checked those links, but from your answer it seems you didn't. It works in shared environment too. And yes as it is running in background so it won't time out and you can fetch body text along with recipient email address.
IloveAjax
Is there anyway to find out a solution with this limitations.
Solutions are always there and you'll get it if you check it out when someone points you to the right direction. Please don't take it otherwise.
IloveAjax
Member
8 Points
60 Posts
Bulk email sending for social networking site.
Jan 20, 2011 05:02 AM|LINK
How do I send bulk emails (around 250 emails at a time) without blocking the current thread so that the emails are send quickly?
I have developed a social networking website at http://www.fineartsbaroda.com . I want a functionality that whenever an artist uploads an artwork, an email should go to all the members.
Currently when someone uploads the artwork, it takes a very long amount of time for sending all these emails.
social networking emai alerts
anfran.mende...
Participant
1398 Points
241 Posts
Re: Bulk email sending for social networking site.
Jan 20, 2011 05:12 AM|LINK
Are you sending the mails one by one to all these 250 people ?
If yes, that is why this much time is taken. Could you try to add all the recepients with a semi colon delimiter rather than sending the mail to all of these people one by one. If that doesnt workout, try to add them all in the CC property.
Could you verify this link with your code :- http://msdn.microsoft.com/en-us/library/system.net.mail.mailmessage.aspx
IloveAjax
Member
8 Points
60 Posts
Re: Bulk email sending for social networking site.
Jan 20, 2011 05:17 AM|LINK
Yes,
I am sending this emails one by one to all. The reason is that these emails provide users with the ability to automatically login to the system. so each email has dynamic text with dynamic link.
nilsan
All-Star
16826 Points
3684 Posts
Re: Bulk email sending for social networking site.
Jan 20, 2011 05:17 AM|LINK
I hope you know how to send an email using Asp.net.
If you want to send bulk email you could get comma delimited string of recipients from database and assign that list of recipients in BCC field and To field will have your own Email Id. You can create batch of recipients (let's say 50) and send it after predefined time interval so that SMTP server doesn't include your email id in Black list and your email won't be considered spam. :)
I hope it makes sense :)
Not getting this part.
nilsan
All-Star
16826 Points
3684 Posts
Re: Bulk email sending for social networking site.
Jan 20, 2011 05:23 AM|LINK
Then I would suggest that you just notify the user that "Email will be sent as background process, you may carry on your work".
To send email in background you can create some kind of scheduler, please check out following links:
http://www.codeproject.com/KB/aspnet/ASPNETService.aspx (article by Omar Al Zabir)
http://beckelman.net/post/2008/09/20/Simulate-a-Windows-Service-Using-ASPNET-to-Run-Scheduled-Jobs.aspx
(Updated version and pretty easy)
When user clicks to send an email, you could just retreive all the recipients from DB and use in function that will be executed until mail is sent to all the receipients. :)
IloveAjax
Member
8 Points
60 Posts
Re: Bulk email sending for social networking site.
Jan 20, 2011 05:27 AM|LINK
The main concern here is the fact that the text for each email changes. Hence cannot send the same email to all the users.
Emails are send when anyone uploads a new artwork on the website. "Email body text is different for each user."
IloveAjax
Member
8 Points
60 Posts
Re: Bulk email sending for social networking site.
Jan 20, 2011 05:30 AM|LINK
Unfortunately, I am on a shared hosting service, which doesn't allow me to run schedulers and services on the server. I am learning about the Amazon cloud computing, and planning to move to amazon server, but I am still not comfortable with it.
Is there anyway to find out a solution with this limitations.
nilsan
All-Star
16826 Points
3684 Posts
Re: Bulk email sending for social networking site.
Jan 20, 2011 05:59 AM|LINK
I wish that you should have checked those links, but from your answer it seems you didn't. It works in shared environment too. And yes as it is running in background so it won't time out and you can fetch body text along with recipient email address.
Solutions are always there and you'll get it if you check it out when someone points you to the right direction. Please don't take it otherwise.