title: Difference between smtplib.sendmail() and email.message["To"]?
body: <p>I have been testing my code to send email to multiple recipients, but i came across a strange observation:</p>
  
  <hr>
  
  <pre><code> message["To"] = 'email_one.sample.com, email_two.sample.com'
   sendmail(mine_email, ['email_one.sample.com'], message.as_string())
  </code></pre>
  
  <p>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.</p>
  
  <p>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.</p>
  
  <p>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>
  
  <p>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</p>
  
  <p><a href="https://stackoverflow.com/questions/8856117/how-to-send-email-to-multiple-recipients-using-python-smtplib">Seen Question link</a></p>