I have this code I wrote:
public static void sendemail(string strMsgBody, string strMsgSubject, ref List<queryResults> offenders)
{
MailMessage mail = new MailMessage(fromEmailAddr@mycompany.com, myEmailAddress@mycompany.com);
SmtpClient client = new SmtpClient();
client.Port = 25;
client.DeliveryMethod = SmtpDeliveryMethod.Network;
client.UseDefaultCredentials = false;
client.Host = "hostname";
mail.Subject = "My Subject Line";
int intDashCounter = 0;
string dashMailBody = strMsgSubject + Environment.NewLine;
foreach (queryResults offender in offenders)
{
if (offender.strType == strMsgBody && offender.blnReported == false)
{
dashMailBody = dashMailBody + offender.strUniqueID + Environment.NewLine;
offenders[intDashCounter].blnReported = true;
}
intDashCounter++;
}
mail.Body = dashMailBody;
client.Send(mail);
}
It was working at one point in time but now it does not work. For the life of me I can't track down what I changed to make it so that it doesn't work. Sorry for this one, I know its probably some stupid little thing but can someone give me a nudge in the right direction with this code?