you had some code here, but not relevant to the point.Īnd get rid of this block of code: for (int i = 0 i < lineCount i++)Īnd notice how data is now properly filled in. This block of code: StreamReader sr = new StreamReader(path1) Using (var message = new MailMessage(fromAddress, toAddress) String finaldata = data + "/n" + data + "/n" + data + "/n" + data + "/n" + data + "/n" + data + "/n" +ĭata + "/n" + data + "/n" + data + "/n" + data + "/n" + data ĭeliveryMethod = SmtpDeliveryMethod.Network,Ĭredentials = new NetworkCredential(fromAddress.Address, fromPassword) Var lineCount = File.ReadLines(path1).Count() ĭata = sr.ReadLine() //Error Comes here. StreamReader sr = new StreamReader(path1) I know that the System.ArgumentOutOfRangeException exception means that number in the array/list doesn't exist, but i don't know what i coded wrongly. I'm making program that sends email with some data.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |