![]() |
|
[C#] Mass Emailer in C# question - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [C#] Mass Emailer in C# question (/showthread.php?tid=3812770) |
Mass Emailer in C# question - xMoD - Oct 18, 2013 I was in the process of building one for myself,l but I wasnt sure which way I should proceed. Here are the options: 1. MailMessage mm = new MailMessage(); SmtpClient smtp = new SmtpClient(); mm.To.Add(Iterate thru all the emails and add them); smtp.Send(); // send the emails all at once. or 2. Loop it like this Add an email address, then send the email Add an email address, then send the email Which one would be better to use? * - Debroski - Oct 18, 2013 I doubt you're going to have SO many it would matter, but if you threaded it, it would go faster, in which you would add e-mail then send back and fourth. * - xMoD - Oct 18, 2013 Okay, thanks I guess I will look into this. 1. I actually have quite a bit from days of harvesting. 2. Im not very good with threading, can you maybe provide a tad bit of help, or links? * - iVision - Oct 18, 2013 I didn't work with the SMTP classes but if you can use an SmtpClient and login with different accounts of course that is more efficient. Because constructing a new instance for one account over and over again is more expensive then using the same instance but with different accounts. For threading I recommend 'studying' the TPL (Task Parallel Library). Its the most efficient to use ;) Example: Code var task = new Task(() => * - xMoD - Oct 18, 2013 :O Whoa, thanks! Ill really be able to use this! |