Since you ask that general, assume you have this (pseudo code):
[pre]foreach(item in items) sendmail(item);[/pre]
If you don't want to send a mail per item, then the simple solution is not to do it in the loop, but after the loop.
[pre]foreach(item in items) addtomailbody(item);
sendmail(mailbody);[/pre]
So you have to define a variable for the mailbody, in which you add line for line, paragraph for paragraph, and finally just send this whole text once.
If you have such a problem with simple program flow, you shouldn't do programming. Seriously.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.