Reading from StreamReader and send email

  • Thread starter Thread starter LloydyJ89
  • Start date Start date
L

LloydyJ89

Guest
Hi All

Hoping someone can help. I have a text file which holds email addresses, i want to read the file and then pass the email addresses to send an email. My code complies and runs however the email never arrives. If i change the code to send to my address it works fine

String[] techemail = new string[10];
string line;
try
{
StreamReader sr = new StreamReader(@"\\C:\AAA\TechEmail.txt");
line = sr.ReadLine();
int i = 0;

while (line != null)
{
techemail = line;
i -= -1;

line = sr.ReadLine();
}

sr.Close();


}
catch
{

}
As stated above if i change the To.Add(myemail@send.com) it works fine

string[] to = techemail;
foreach (var m in to)
{
testtimestamp.To.Add(m);

}


What am i missing

Thanks in advance

Continue reading...
 
Back
Top