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('sender@mail.com', ['recipient@mail.com', 'recipient2@mail.com', 'recipient3@mail.com'], 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('sender@mail.com', mailList, msg.as_string())
The mainList.txt contains:
['recipient@mail.com', 'recipient2@mail.com', 'recipient3@mail.com']
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!