/********************************************************

	EG2100_Mail.c
	2001, Z-World

	Example of a target board sending email while
	connected to a EG2100 RabbitLink board.

	This program demonstrates the ability of a Rabbit-
	based target board to send email via the SMTP
	client on the RabbitLink board it is connected to.
	
	Make sure that the "MAIL FROM" and "MAIL SERVER"
	options have been set in the RabbitLink console
	before running this program!
		
 ********************************************************/

// change this to an actual address
#define	EMAIL_ADDR	"petercottontail@myrabbitwarren.com"
 
#define	CTRL_D	0x04
 
main()
{
	// enable all STDIO to go to the RabbitLink console
	PrintToConsole(1);

	// make sure we are not in the middle of a command
	printf("\n");

	// turn off local echo
	printf("echo off\n");

	// send email command
	printf("mail %s\n", EMAIL_ADDR);
	printf("this is the subject\n");			// subject
	printf("This is the body\n");				// body
	printf("%c", CTRL_D);						// end message

	// stop all STDIO from going to RabbitLink console
	PrintToConsole(0);
}
