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

前端 未结 5 741
不思量自难忘°
不思量自难忘° 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:30

    It needs to be a real list. So, with this in the file:

    recipient@mail.com,recipient2@mail.com,recipient3@mail.com
    

    you can do

    mailList = urlFile.read().split(',')
    

提交回复
热议问题