I try to send mails from python to multiple email-addresses, imported from a .txt file, I've tried differend syntaxes, but nothing would work...
The code:
s.sendmail('[email protected]', ['[email protected]', '[email protected]', '[email protected]'], msg.as_string())
So I tried this to import the recipient-addresses from a .txt file:
urlFile = open("mailList.txt", "r+")
mailList = urlFile.read()
s.sendmail('[email protected]', mailList, msg.as_string())
The mainList.txt contains:
['[email protected]', '[email protected]', '[email protected]']
But it doesn't work...
I've also tried to do:
... [mailList] ... in the code, and '...','...','...' in the .txt file, but also no effect
and
... [mailList] ... in the code, and ...','...','... in the .txt file, but also no effect...
Does anyone knows what to do?
Thanks a lot!