我嘗試從python發送郵件到多個電子郵件地址,從.txt文件導入,我嘗試了differend語法,但沒有任何工作...用Python發送電子郵件到.txt文件的多個收件人smtplib
代碼:
s.sendmail('[email protected]', ['[email protected]', '[email protected]', '[email protected]'], msg.as_string())
所以,我想這從.txt文件導入接收者地址:
urlFile = open("mailList.txt", "r+")
mailList = urlFile.read()
s.sendmail('[email protected]', mailList, msg.as_string())
的mainList.txt包含:
['[email protected]', '[email protected]', '[email protected]']
但它不工作...
我也試着做:
... [mailList] ... in the code, and '...','...','...' in the .txt file, but also no effect
和
... [mailList] ... in the code, and ...','...','... in the .txt file, but also no effect...
有誰知道該怎麼做?
非常感謝!
謝謝。這對我有效。 – aku