Home/Support/Support Forum/Multiline for tthe email BODY.
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

Multiline for tthe email BODY.

0 votes
Hi All,

I am trying to send a sale report via email. The BODY should contain multilines similar to this:

~(example)
float price = 3.76
int CoinCounter: = 3
float sales = 0;
CanRemaining = 5;
sales = CoinCounter * price;
strcpy(SUBJECT,"Sales Report\n");

// EMAIL BODY

BODY = "Sales: " + sales + "\n"
+ "Coins: " + CoinCounter + "\n"
+ "Cans Remaining: " + CanCounter;


How can I achieve that with Dynamic C?
Thanks!
asked Apr 29, 2014 in Rabbit by ebodely New to the Community (0 points)

Please log in or register to answer this question.

1 Answer

0 votes
the simplest way to do this is to construct the body in a buffer using sprint that way you can build up the text in the same way that you would use for printing it out normally:

e.g.

char BODY[1000];
int pos = 0;

pos = snprintf( BODY, "Sales %f\nCoiins %d\n", sales, coinis);

Regards,
Peter
answered Apr 29, 2014 by petermcs Veteran of the Digi Community (1,128 points)
...