Passing a string from Active.c to smtp_sendmail()

I use modification of DC9.50 \Samples cpip\Active.c to succesfully get the first 100 characters of HTML code of a web page.
Active.c has this section of code:
do {
bytes_read=sock_fastread(&socket,buffer,sizeof(buffer)-1);

	if(bytes_read>0) {
		buffer[bytes_read] = '\0';
		/*
		 * By using the "%s" format, if there are "%" in the buffer, printf()
		 *  won't try to interpret them!
		 */
		printf("%s",buffer);
}

The line printf(“%s”,buffer); successfully displays the desired string in STDIO.

I then added a modification of DC9.50 \Samples cpip\SMTP.c after the modified Active.c code to email this string.

SMTP.c defines strings as:

#define FROM “myaddress@mydomain.com
#define TO “myaddress@mydomain.com
#define SUBJECT “You’ve got mail!”

/* I commented this out since the Active.c code declares
char buffer[100];
#define BODY "Visit the Rabbit Semiconductor web site.
"
“There you’ll find the latest news about Dynamic C.” */

SMTP.c then uses:
smtp_sendmail(TO, FROM, SUBJECT, BODY);

By Using smtp_sendmail(TO, FROM, SUBJECT, buffer); My program only emails the first six characters of the desired string.
I don’t understand enough about strings to get the string which printf() used successfully into smtp_sendmail().
Would you please suggest a way to do this?
Thanks!

Question #1: Is buffer a local array in Active.c, or is it a global array?

Question #2: If buffer is a local array, does Active.c call SMTP.c ?

Question #3: How does SMTP.c know where to find buffer declared in Active.c ?

The character array buffer is declared near the top of main(). I have put all the code, except #defines in main(). There are no function calls.

Hi marco, ( ciao Marco )

your strings are defined as arrays of char then filled up into main
or you have defined the drings with
#define directive?

is different using of memory

and which core are you uising

Bye

Marco