Can anyone tell my why I'm getting the error [AttributeError: 'list' object has no attribute 'encode']
fromaddr = ['Email']
sendto = ['Email']
This looks a little odd to me. Shouldn't they be strings, not lists?
fromaddr = 'Email'
sendto = 'Email'
Still I was getting an error, so I did below changes and it worked for me.
toaddr = ['mailid_1','mailid_2']
cc = ['mailid_3','mailid_4']
bcc = ['mailid_5','mailid_6']
subject = 'Email from Python Code'
fromaddr = 'sender_mailid'
message = "\n !! Hello... !!"
msg['From'] = fromaddr
msg['To'] = ', '.join(toaddr)
msg['Cc'] = ', '.join(cc)
msg['Bcc'] = ', '.join(bcc)
msg['Subject'] = subject
s.sendmail(fromaddr, (toaddr+cc+bcc) , message)