Tôi cố gắng gửi thư từ python đến nhiều địa chỉ email, được nhập từ tệp .txt, tôi đã thử các cú pháp khác, nhưng không có gì hoạt động ...Gửi email tới nhiều người nhận từ tệp .txt với Python smtplib
mã:
s.sendmail('[email protected]', ['[email protected]', '[email protected]', '[email protected]'], msg.as_string())
Vì vậy, tôi đã cố gắng này để nhập người nhận-địa chỉ từ một file .txt:
urlFile = open("mailList.txt", "r+")
mailList = urlFile.read()
s.sendmail('[email protected]', mailList, msg.as_string())
các mainList.txt chứa:
['[email protected]', '[email protected]', '[email protected]']
Nhưng nó không hoạt động ...
Tôi cũng đã cố gắng để làm:
... [mailList] ... in the code, and '...','...','...' in the .txt file, but also no effect
và
... [mailList] ... in the code, and ...','...','... in the .txt file, but also no effect...
Có ai biết phải làm gì?
Cảm ơn rất nhiều!
Cảm ơn bạn. Điều này làm việc cho tôi. – aku