Give me a second..I'm going to post an email class we use here. Also, just another thought...I know of some developers that use the database and have a form of a mail queue to help process large numbers of emails in batches....just something to consider.
jmurrayhead
If you agree, give me rep.
If you like it here...throw us a few bones to help support us.
See my sample Email class here: http://www.developerbarn.com/net-cod...-new-post.html
Basically, instead of passing the entire array of email ID's to the function, you should just call this function in a loop.
As far as the database mail queue...you could have a table like so:
MailQueueId
DateLine
ToEmail
FromEmail
Subject
Message
Then have some sort of scheduled task that queries for the TOP 100 records and shoots of an email, for example. This task could be run every x minutes.
jmurrayhead
If you agree, give me rep.
If you like it here...throw us a few bones to help support us.
Thanx J, i'll have a look at the link.
I need to send mail on button click, its like an mail for an update for a match.
So i have to get all people subscribed to that match and send them mail.
Since this number can be huge, thats why i am sending mail asynchronously.
Right M, on the button click, it would populate the mail queue. Then, have the scheduled task set for every 5 minutes or so. It will be instantaneous enough, yet, send emails in batch. Once the email is sent for the TOP x users, then you clear them from the database.
jmurrayhead
If you agree, give me rep.
If you like it here...throw us a few bones to help support us.
Hmm, thanx J
I'll see how it goes.
And thanx for that email class![]()
M, for the email class that I showed you, you will only be passing one email address to it through each iteration of the loop. As I mentioned above, the SendMail function will be called in a loop, but you won't pass the entire string of email IDs, just one of them each time.
jmurrayhead
If you agree, give me rep.
If you like it here...throw us a few bones to help support us.
jmurrayhead
If you agree, give me rep.
If you like it here...throw us a few bones to help support us.
Bookmarks