I’ve been doing some testing of email enabled lists, and I needed to send quite a lot of emails, so I wrote a little console app to do it. Here’s the core of the code I used, in case I need it again, or it’s useful to someone. It uses System.Net.Mail:
SmtpClient smtp = new SmtpClient(@"vm-moss2007.virtual.local");
for (int i = 1; i <= 100; i++)
{
MailMessage message = new MailMessage("administrator@virtual.local", <a href="mailto:testlist@sharepoint.virtual.local">testlist@sharepoint.virtual.local</a>);
message.Subject = string.Format("Message {0}", i);
message.Body = string.Format("This is message '{0}'", i);
Console.WriteLine("Sending {0}", i);
smtp.Send(message);
}

