macro_file mail;

#INCLUDE windows.sh
#INCLUDE mapi.sh

void MailSendFile( str fn = parse_str("/F=", mparm_str) )
{
	if( fn == "")
	{
		if ( file_changed ) {
			RM("SAVEFILE /NP=1");
		}
		fn = file_name;
	}
	else
	{
		int jx = 1;
		while( jx = xpos(" ", fn, jx))
		{
			fn = str_ins( ";", str_del(fn,jx,1), jx );
		}
	}
	Working;
	MAPISendDocuments(0, ';', fn, truncate_path(fn), 0);
}

int MapiEnabled()
{
	return( GetProfileInt( "MAIL", "MAPI", 0) == 0 );
}