Can I use setTimeout() inside for loop?

I’m trying to slow down sending of emails so I don’t overload my mailserver but I can’t get the timeout to work. My code is:-

for (let i = 0; i < emailList.length; i++) {
        variables.emailAddress = emailList[i].primaryInfo.email;
        variables.firstName = emailList[i].info.name.first;
        $w('#confirmationMessage').text=`Sending message #${i+1}`;
        setTimeout(function() {myFunc($w('#confirmationMessage').text)}, 2000);
}
function myFunc(p1) {
    console.log(p1);
    emailContact($w('#templateList').value, variables);
}

I’ve also tried amongst other things:-

setTimeout(() => {
	console.log(p1);
	emailContact($w('#templateList').value, variables);
}

But I can’t get any permutation to work. Can anyone give me a heads-up on where I’m going wrong?