How do I send a variable in the body of an e-mail?

Hello, I have been unsuccessful at sending a variable in the body of an e-mail. I have created an array using sprint as a buffer, but has not worked.
pos = sprintf(body, “this is a test”, varaible);
emailArray[0].body = pos;

variable declared as float.

I am able to send text.

Cloud someone please offer a suggestion on how to do this?

Thank you,

Good afternoon, I suggest doing a GREP search in Dynamic C for “email”, there are several different sample that would help you

1 Like

There is no print specifier in your example above for variable. Try something like:

pos = sprintf(body, “this is a test %f”, varaible);


1 Like

You should be able to do something along the lines of:

auto char buffer[128];
int data;

sprintf(buffer, “Data is %d”, data);
emailArray[0].body = buffer;

1 Like