I am creating a program that sends an email with some data the program collected from the user beforehand.
Currently, my problem is that when i use:
string subject = "test {0}", test2;
The email I receive is this output:
test {0}
and not the expected output of:
"test test2".
Is there something I am missing?
I just tested something else out, by removing the text and only using the variable as a subject, worked fine. But why isnt the text/string + variable working?
Vs says that the variable I am adding, test2
, is already defined.
Full code:
string test2 = "test";
string subject = "test {0}", test2;
string body = "test1";