Change this code:
to='[email protected],[email protected]'
to=['[email protected]','[email protected]']
And this:
msg['To'] =to
msg['To'] =" ".join(to)