Friday, March 16, 2012

Mass emails

I need to email my client database of emails, but doing this is just too
slow:
..pseud code
while(have emails)
{
//fetch email
//preinitialised smtpclient object with host and message used
smtpclient.sendemail();
}
I have seen some complex codes written for mass emailing, why is the aboce
so slow and what are the issues with doing it this way? Could anyone point
me to the 'right' method? I already page my sql server via a stored proc to
bring back the data in 1000 record chunks.
I use asp.net 2 and c#
ThanksHello,
I had a similar issue long time ago using .net fx 1.1, the workaround that
I found was to send an e-mail for each ten persons (then if you have 1000
contacts you will only send 100 e-mails), that worked perfect for me, I'm no
t
sure if I had to workaround the thing of getting several persons in the "To"
field (I think that didn't happened).
Good Luck
Braulio
PS: More Info about SMTP and ASP .net
http://www.tipsdotnet.com/ArticleBl...MTP&PageIndex=0
/// --
/// Braulio Diez
///
/// http://www.tipsdotnet.com
/// --
"PokerMan" wrote:

> I need to email my client database of emails, but doing this is just too
> slow:
> ...pseud code
> while(have emails)
> {
> //fetch email
> //preinitialised smtpclient object with host and message used
> smtpclient.sendemail();
> }
> I have seen some complex codes written for mass emailing, why is the aboce
> so slow and what are the issues with doing it this way? Could anyone point
> me to the 'right' method? I already page my sql server via a stored proc t
o
> bring back the data in 1000 record chunks.
> I use asp.net 2 and c#
> Thanks
>
>
Thank you for the reply...
I have 8100 people at present so i page 1000 at a time into the datareader,
loop it and send. If i add 10 people to the email ata time i think it does
then put all 10 in the To field. Unless i use bcc? And make the to field a
dummy address? What would be your best advice here?
i will investigate this method tho, thanks...anyone else with any other
methods or tips?
"Braulio Diez" <braulio121NOSPAM@.yahoo.es> wrote in message
news:985A863D-708E-4614-82AC-67E5F23EB7C4@.microsoft.com...
> Hello,
> I had a similar issue long time ago using .net fx 1.1, the workaround
> that
> I found was to send an e-mail for each ten persons (then if you have 1000
> contacts you will only send 100 e-mails), that worked perfect for me, I'm
> not
> sure if I had to workaround the thing of getting several persons in the
> "To"
> field (I think that didn't happened).
> Good Luck
> Braulio
> PS: More Info about SMTP and ASP .net
> http://www.tipsdotnet.com/ArticleBl...MTP&PageIndex=0
>
> /// --
> /// Braulio Diez
> ///
> /// http://www.tipsdotnet.com
> /// --
>
>
> "PokerMan" wrote:
>
Try the several to's approach I think it doesn't show all the To's in every
mail (at least I think it was that way on system.web.mail).
Tell me if the approach works, if not we have to find another workaround :-)
/// --
/// Braulio Diez
///
/// http://www.tipsdotnet.com
/// --
"PokerMan" wrote:

> Thank you for the reply...
> I have 8100 people at present so i page 1000 at a time into the datareader
,
> loop it and send. If i add 10 people to the email ata time i think it doe
s
> then put all 10 in the To field. Unless i use bcc? And make the to field a
> dummy address? What would be your best advice here?
> i will investigate this method tho, thanks...anyone else with any other
> methods or tips?
>
> "Braulio Diez" <braulio121NOSPAM@.yahoo.es> wrote in message
> news:985A863D-708E-4614-82AC-67E5F23EB7C4@.microsoft.com...
>
>
It doesn't shed any light about the multiple "To's" issue, but I would try t
his
http://weblogs.asp.net/scottgu/arch.../10/432854.aspx
I know is very basic, but worth to give a try.
/// --
/// Braulio Diez
///
/// http://www.tipsdotnet.com
/// --
"Braulio Diez" wrote:
> Hello,
> I had a similar issue long time ago using .net fx 1.1, the workaround th
at
> I found was to send an e-mail for each ten persons (then if you have 1000
> contacts you will only send 100 e-mails), that worked perfect for me, I'm
not
> sure if I had to workaround the thing of getting several persons in the "T
o"
> field (I think that didn't happened).
> Good Luck
> Braulio
> PS: More Info about SMTP and ASP .net
> http://www.tipsdotnet.com/ArticleBl...MTP&PageIndex=0
>
> /// --
> /// Braulio Diez
> ///
> /// http://www.tipsdotnet.com
> /// --
>
>
> "PokerMan" wrote:
>
"PokerMan" <nospam@.pokercat.co.uk> wrote in message
news:%23X7bHzDMIHA.2064@.TK2MSFTNGP06.phx.gbl...
> Thank you for the reply...
> I have 8100 people at present so i page 1000 at a time into the
> datareader, loop it and send. If i add 10 people to the email ata time i
> think it does then put all 10 in the To field. Unless i use bcc? And make
> the to field a dummy address? What would be your best advice here?
> i will investigate this method tho, thanks...anyone else with any other
> methods or tips?
put the addresses in BCC unless you want all the recipients to know who else
got the email ... even if you don't care, it looks sloppy on the TO line and
may get spam-trapped if this is external mail
so how slow is "slow" ? could be you're ok and could be that BCC'ing and
the like is ducking the issue of figuring out a more efficient way to do the
job, which you may or may not care about ...

> "Braulio Diez" <braulio121NOSPAM@.yahoo.es> wrote in message
> news:985A863D-708E-4614-82AC-67E5F23EB7C4@.microsoft.com...
>
As another person asked, how slow is "slow"? We occasionally send about 3000
and it takes 30-45 minutes.
What exactly are you doing in "preinitialised smtpclient object with host
and message used"? More specifically, are you disconnecting and
re-connecting to the SMTP server every time? All you need to do is change
the "TO" line (and perhaps the message body, if desired) and send the new
email.
If all else fails, consider using a list service instead.
Scott
Yep thats exactly what i am doing.
By pre-init, as in host doesnt change, from doesnt change etc. So i just doa
smtpclient.send in aloop, and i am getting similar time frames, which to me
is quite poor? On the 8k ppl i geta time out and it runs for along time,
what about huge databases of 100k plus people, how do they do it? If 3k ppl
takes 30 minutes, thats 100 every minute, so a 100k ppl is 16hrs plus! There
must be a more efficient way surely? My database is growing rapidly and i am
worrying aboutt he scalability of my solution? Any ideas?
For now i will try the bcc and bulk them in so a load go with one smtp
client send and try and improve it that way.
Thanks in advance, i look forward to hearing other methods
"Scott Roberts" <sroberts@.no.spam.here-webworks-software.com> wrote in
message news:eo2sK7EMIHA.1204@.TK2MSFTNGP03.phx.gbl...
> As another person asked, how slow is "slow"? We occasionally send about
> 3000 and it takes 30-45 minutes.
> What exactly are you doing in "preinitialised smtpclient object with host
> and message used"? More specifically, are you disconnecting and
> re-connecting to the SMTP server every time? All you need to do is change
> the "TO" line (and perhaps the message body, if desired) and send the new
> email.
> If all else fails, consider using a list service instead.
> Scott
>
>
>
>
"PokerMan" <nospam@.pokercat.co.uk> wrote in message
news:%23p2tUUFMIHA.748@.TK2MSFTNGP04.phx.gbl...

> what about huge databases of 100k plus people, how do they do it? If 3k
> ppl takes 30 minutes, thats 100 every minute, so a 100k ppl is 16hrs plus!
> There must be a more efficient way surely? My database is growing rapidly
> and i am worrying aboutt he scalability of my solution? Any ideas?
keep in mind: 100k is a pint-sized mailing list; these jerks who send out
millions of Viagra ads are probably physcially located next to the backbone,
buy a lot of bandwidth, use an industrial strength mail server built with
mass-mailing in mind, use multiple servers, etc etc ... there's more going
on than how good your C# code is ...
I think we know that any half-decent C# code can easily package up a LOT OF
EMAILS in a really short time; the limiting factor here is almost certainly
on the network ... unless your code is really, really bad ...

> On the 8k ppl i geta time out and it runs for along time,
> what about huge databases of 100k plus people, how do they do it? If 3k
> ppl takes 30 minutes, thats 100 every minute, so a 100k ppl is 16hrs plus!
> There must be a more efficient way surely? My database is growing rapidly
> and i am worrying aboutt he scalability of my solution? Any ideas?
Is there a particular reason that time is a problem?
As I mentioned before, you might look into a list service. I'm guessing that
there is tighter integration with the mail server and speeds are much
better.

0 comments:

Post a Comment