Send Email to multiple recipients from .txt file with Python smtplib

前端 未结 5 728
不思量自难忘°
不思量自难忘° 2020-12-06 08:23

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:



        
5条回答
  •  一向
    一向 (楼主)
    2020-12-06 08:39

    urlFile = open("mailList.txt", "r+")
    mailList = [i.strip() for i in urlFile.readlines()]
    

    and put each recipient on its own line (i.e. separate with a line break).

提交回复
热议问题