Error with Send Mail in SSIS

Hi experts,
I can't get this to work.
So variable @CountOfFilesCopied is defined as int in package
In the SQL Task, Parameter mapping is set to User::CountOfFilesCopied Input Long @CountOfFilesCopied -1
In this testing.... @CountOfFilesCopied has a value of 2

When I run it as below, I get this error:
Conversion failed when converting the varchar value '?' to data type int.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.

If I run it without the quote as Declare @CountOfFilesCopied int = ?;
it fails with "profile name is not valid". (The profile SQLMail is valid, I have confirmed that)

Declare @Body1 varchar(250);
Declare @CountOfFilesCopied int = '?';

Set @Body1 = concat('Nbr of files copied: ', cast(@CountOfFilesCopied As varchar(10)));

EXEC msdb.dbo.sp_send_dbmail
@profile_name = 'SQLMail',
@body = @Body1,
@body_format ='HTML' ,
@recipients = ';',
@subject = 'Image Copy Has completed';

You are trying to assign string, '?' to a variable you are declaring as int. Change it to

Declare @CountOfFilesCopied VARCHAR(32) = '?';

Set @Body1 = concat('Nbr of files copied: ', @CountOfFilesCopied);

When passing a parameter to a script in an Execute SQL Task - the parameter placement holder is assigned using a ?.

The code should be:

Declare @CountOfFilesCopied int = ?;

Notice this does not have any single-quotes around it.