u may put the required string into a text file, just like
"echo this it the text > msgbody"
then something like this (I'd ) mail user < msgbody.
example of the code maybe (I'm not really sure it works)
#include <stdio.h>
int main()
{
char cmd[80];
int icount = 0;
int i = 0;
for (i = 0; i < 10; i++)
{
system("echo this is msgbody > msgbody");
sprintf(cmd, "mail -s \"This a test message%d\"
minhsangtech@gmail.com < msgbody");//<- HOW TO PASS MESSAGE BODY IN IT?
if (system(cmd) == -1)
{
printf("Cannot send email\n");
}
}
return -1;
}
hope this help u.