I have been testing my code to send email to multiple recipients, but i came across a strange observation:
message["To"] = 'email_one.sample.com, email_two.sample.com'
sendmail(mine_email, ['email_one.sample.com'], message.as_string())
The above two lines give me an output wherein i get to see the email_id of both recipients in the header's section but despite the fact that i only passed a single recipient's id in the sendmail() method, the email is sent to both id's nonetheless.
Also vice versa if i pass a single email_id into the message["To"] and multiple email_id's in the sendmail() method the email is sent to all of the recipients in the sendmail() method but they only see a single id in the header section.
So now i am a bit confused as to what exactly happens behind the scenes that causes such strange behaviour. How exactly does a recipient whose email_id i do not pass into the sendmail() method receive an email, just by passing that email id into the message["To"] part.
P.S.: i have already seen the below answer and although it covers the syntax in great details i am merely asking about the strange behaviour pertaining to my above mentioned problem