Quote:
DataTable dtgetemailcode = ...;
...
msg.To.Add(dtgetemailcode.ToString());
The variable
dtgetemailcode
is a
DataTable
. Calling
.ToString()
on that variable will return it's
TableName
. This will either be an empty string, or something like
Table1
. That is clearly
NOT a valid email address.
You need to use the value of the correct column of the correct row of the
DataTable
instead.