I have a thread running in the background that will sleep and pull data from the database when something wakes it up. I am sending the emails using google apps using SmtpClient (code below).
I wanted to know if there is anything i be aware of? I plan to send only one email at a time (a registration or forgot password email). I am a little worried something can happen like an invalid email locking up the thread because i didnt set a timeout or maybe google apps happen to be done and causing the app to blow up. What should i be aware off? I should ask how i should test as well?
var client = new SmtpClient("smtp.gmail.com", 587)
{
Credentials = new NetworkCredential(fromAddr, pass),
EnableSsl = true
};
MailMessage mail = new MailMessage(fromAddr, toAddr, subject, body);
mail.IsBodyHtml = true;
client.Send(mail);