function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Logged in user email in Single email message toAddress.

We are sending email from apex code and adding toAddress from code only. Email template is used. When email is firing from code the email of logged in user automatically gets added in toAddress email.
Checked complete code, email alert, email settings and all the user settings but not able to track from where its adding that email.
Also added debugs before instance of single message to check before firing but user email is not in toAddress.(Please find below screenshot of debug log).User-added imagePlease let me know if anyone faced this kind of behaviour.
SwethaSwetha (Salesforce Developers) 
Usually toAddress must have at least one email address. Have you tried specifying another email and check if you are still seeing the logged-in user's id?