If 2-Step Verification/2 Factor is turned on/in use, you must create an app password for the printer to use. (This is _not_ a Passkey).
https://support.apple.com/en-gb/HT204397
Sign in to https://appleid.apple.com
In the Sign-In and Security section, select App-Specific Passwords
Select Generate an app-specific password or select the Add button Blue plus sign icon., then follow the steps on your screen.
Copy this code as it will be used below in Step 5., 3.
... on the printer's web page
Set SMTP Protocol to On
Set SMTP Port Number to 587
Set SMTP Server Name to smtp.mail.me.com
Set SMTP Server Timeout to 180
Set Authentication Protocol to On
Set Authentication as to Other
Set Login User Name to your full iCloud email address (for example, emilyparker@icloud.com, not emilyparker)
Set Login Password or use the app-specific password that was generated
The maximum length of the Login Password is 64 characters
Generate an app-specific password at https://support.apple.com/en-gb/HT204397
Set SMTP Security to STARTTLS
Set Sender Address to the _same_ email address as used for the Login User Name
The maximum length of the sender address is 128 characters
Set SMTP Authentication and Sender Address to Use System Settings
Only some models have this setting