Can't get the source above to compile but I did notice the following :
To send the mail, you need to do something like this :
SmtpClient client = new SmtpClient("mail.t-com.hr");
I suspect that your exception may be coming from the dataGridView2 passed into the htmlMessageBody method. Step through the code and make sure that the variable 'dg' is not null when it enters that method.